-
Aug 25th, 2006, 02:57 AM
#1
Thread Starter
Addicted Member
Align Labels on a form
Hi,
I have set my form to be maximized on the screen on load and i have a label which on my screen resolution is centered.
How do i get this label to be centered on the form no matter what the screen resolution of the user.
There is no align property for a lable in vb6 that i can find.
Many Thanks
Steve
-
Aug 25th, 2006, 03:07 AM
#2
Re: Align Labels on a form
VB Code:
Private Sub Form_Resize()
Label1.Left = Me.ScaleWidth / 2 - Label1.Width / 2
End Sub
-
Aug 25th, 2006, 03:16 AM
#3
Lively Member
Re: Align Labels on a form
or for the center of screen...try this
Label1.Left = (Screen.Width - Label1.Width) / 2
Label1.Height = (Screen.Height - Label1.Height) / 2
-
Aug 25th, 2006, 03:16 AM
#4
Lively Member
Re: Align Labels on a form
or for the center of screen...try this
Label1.Left = (Screen.Width - Label1.Width) / 2
Label1.Top = (Screen.Height - Label1.Height) / 2 .....sorry...wrong code
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|