Theirs 2 ways that come to my mind and the easiest, but ugliest way is just docking them through the properties page. (Not gonna say anything else about this.)
The second more controllable way is by giving a button a certain distance from another button and that button has a certain distance from the form border.
so if U resize the form the button follows the border and the other button follows the button.
Example:
Needed:
- A form (Mr. Obvious in the house o_o)
- 2 Buttons
Code:
Code:
Dim X1 As Integer
Dim Y1 As Integer
Dim X2 As Integer
Dim Y2 As Integer
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
X1 = ((Val(Me.Size.Width) / 2) - (Val(Button1.Size.Width) / 2))
Y1 = ((Val(Me.Size.Height) / 2)) - (Val(Button1.Size.Height / 2))
X2 = Val(Button1.Location.X)
Y2 = Val(Button1.Location.Y) + Val(Button2.Size.Height)
Button1.Location = New System.Drawing.Point(X1, Y1)
Button2.Location = New System.Drawing.Point(X2, Y2)
End Sub
Extra:
It's certainly not perfect or efficient but it's the best controllable way I know of.