chadmanvb
asked on
center label in a form
I know how to center a label on my form for a fixed Length, but I have a variable that will change in length. I would like it to display in the center regardless of the length. How would I do that? Thanks, Chad
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks worked great! Chad
ASKER
dim x as integer=form1.width/2 - label1.width/2
label1.location=new point(x,y)
If I do it like:
dim x as integer=485/2 - label1.width/2
label1.location=new point(x,205)
This works, but would get messed up if I change the form size.
It does not like the "form1.width"? It recomended I try using me instead, but could not get that to work either. Am I missing something? Not a big deal because this will also work.
Thanks, Chad