I have the following code from the example in VB6.0 that comes with Visual Studio. It is not working. How can I assign the hieght,width,top and left properties so the buttons are in the right position?
Private Sub UserControl_Resize()
'This code will execute when the MyData is initialized or
'whenever it is resized to rearrange the constituent
'controls and provide a consistent appearance
lblCaption.Move 0, 0, Width, Height
CmdFirst.Move 0, 0, cmdFirst.Width, Height - 60
CmdPrev.Move CmdFirst.Left + CmdFirst.Width, 0, _
CmdPrev.Width, Height - 60
CmdLast.Move (Width - CmdLast.Width) - 60, 0, _
CmdLast.Width, Height - 60
CmdNext.Move CmdLast.Left - CmdNext.Width, 0, _
CmdNext.Width, Height - 60
lblCaption.Height = TextHeight("A"
lblCaption.Move CmdPrev.Left + _
CmdPrev.Width, ((Height - 60) _
/ 2) - (lblCaption.Height / 2), _
CmdNext.Left - (CmdPrev.Left _
+ CmdPrev.Width)
End Sub
Private Sub UserControl_Resize()
'This code will execute when the MyData is initialized or
'whenever it is resized to rearrange the constituent
'controls and provide a consistent appearance
lblCaption.Move 0, 0, Width, Height
CmdFirst.Move 0, 0, cmdFirst.Width, Height - 60
CmdPrev.Move CmdFirst.Left + CmdFirst.Width, 0, _
CmdPrev.Width, Height - 60
CmdLast.Move (Width - CmdLast.Width) - 60, 0, _
CmdLast.Width, Height - 60
CmdNext.Move CmdLast.Left - CmdNext.Width, 0, _
CmdNext.Width, Height - 60
lblCaption.Height = TextHeight("A"
lblCaption.Move CmdPrev.Left + _
CmdPrev.Width, ((Height - 60) _
/ 2) - (lblCaption.Height / 2), _
CmdNext.Left - (CmdPrev.Left _
+ CmdPrev.Width)
End Sub