Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving TextBoxes Problem

Status
Not open for further replies.

Phi1Smith

Programmer
Jun 5, 2001
33
0
0
GB
Hi
I'm trying to use this code below to move some controls within a tab control, when I uncomment the objControl.Left or objControl.Move the Controls no longer stay on their on tab.


With rsControls
.Open strSQL, ConnMain, adOpenDynamic, adLockReadOnly
Do While Not .EOF
For Each objControl In objForm.Controls
sName = objControl.Name
If sName = !FrmContName Then
If !FrmContVisible Then
On Error Resume Next
'objControl.Move !FrmContLeft
'objControl.Left = !FrmContLeft
objControl.Top = !FrmContTop
objControl.Width = !FrmContWidth
objControl.Height = !FrmContHeight
objControl.Caption = !FrmContCaption
objControl.FontSize = !FrmContFontSize

Else
objControl.Visible = False
End If
End If
Next
.MoveNext
Loop
.Close
End With

Many Thanks in advance

Phil
 
I would just place all of the controls belonging to a certain Tab onto a Frame control.

Then, if needed, I would check the control's container as to which frame it belongs to:

If UCase$(objControl.Container.Name) = "MYFRAME1" Then

or, if you use a fram array:

If UCase$(objControl.Container.Name) = "MYFRAME" Then
If objControl.Container.Index = 1 Then



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top