|
If your Main Form loads in Maximized, So you have to give the Left and Top values of each controls using the Main Form's width and height.Then whatever the resolution of your screen the controls of your main form will be placed properly on the main form.
Eg:
If you need to have a command button in the middle of your form. You could use this code.
Private Sub Form_Load() Place_Contorls End sub
Private Sub Form_Resize() Place_Contorls End Sub
Sub Place_Contorls() Command1.Left = (Form1.Width / 2) - (Command.Width / 2) Command1.Top = (Form1.Height/ 2) - (Command.Height / 2) End sub
Then, whatever the resolution is , this will place Command1 in the middle of the form. If you resize the form the same thing will happen. If you have number of controls on your form you need to give their left and top values using other controls as well.
|