How to position a control in the lower right corner
of a MAXOMIZED form!
Printable View
How to position a control in the lower right corner
of a MAXOMIZED form!
Dont use the form maximize thing, instead use the code I provided below
Code:Private Sub Form_Load()
Form1.Height = Screen.Height
Form1.Width = Screen.Width
Form1.Left = 0
Form1.Top = 0
'lets say that the control is a label
Label1.Left = Form1.Width - Label1.Width
Label1.Top = Form1.Height - Label1.Height * 2
End Sub
Thanks. Pretty Good!!!
This code (MAXIMIZE):
and yours is the same thing, dimava, you can maximize the form and still get the screen width.Code:Private Sub Form_Load()
Form1.Windowstate = vbMaximized
Label1.Left = Form1.Width - Label1.Width
Label1.Top = Form1.Height - Label1.Height * 2
End Sub
Some forms cannot be sized beyond a point, and the user may maximize a form, in which case your code might generate an error.
Also, if you size the form that way, it would allow the user to resize it, and it's handlebars would be sticking out.
what happens when you set the form's property to MAXIMIZE is that you are saying:
I'm only gonna put stuff on what I have in the dsign view, and just put the back ground color on the remaining part
the code that I did is saying:
I'm gonna use the whole screen, and put stuff on the whole screen, not just the box that I put stuff in at design time