VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 300,336 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,654 people online right now. Registration is fast and FREE... Join Now!




Center Buttons

 

Center Buttons

sraptor

30 Apr, 2009 - 09:39 AM
Post #1

New D.I.C Head
*

Joined: 22 Apr, 2009
Posts: 25



Thanked: 1 times
My Contributions
I have a form with 6 buttons, when form get maximize the buttons is not in the center anymore, how can I do the buttons get in the center always?

Thanks

User is offlineProfile CardPM
+Quote Post


egof

RE: Center Buttons

30 Apr, 2009 - 10:41 AM
Post #2

D.I.C Head
Group Icon

Joined: 27 Mar, 2009
Posts: 95



Thanked: 12 times
Dream Kudos: 100
My Contributions
I usually put those kinds buttons in a group box then center the box. On the form resize event you want to know where to place the left side of the group box. This can be done be getting the width of the form and subtracting the width of the group box and dividing by 2

This post has been edited by egof: 30 Apr, 2009 - 10:42 AM
User is offlineProfile CardPM
+Quote Post

sraptor

RE: Center Buttons

30 Apr, 2009 - 10:51 AM
Post #3

New D.I.C Head
*

Joined: 22 Apr, 2009
Posts: 25



Thanked: 1 times
My Contributions
Do you know wich code I use for the resize, I ready add the buttons to the group box. But if it get maximize still the same problem, that screen always run maximaze
User is offlineProfile CardPM
+Quote Post

Asscotte

RE: Center Buttons

30 Apr, 2009 - 11:01 AM
Post #4

D.I.C Regular
Group Icon

Joined: 8 Feb, 2009
Posts: 398



Thanked: 10 times
Dream Kudos: 175
My Contributions
QUOTE(sraptor @ 30 Apr, 2009 - 10:51 AM) *

Do you know wich code I use for the resize, I ready add the buttons to the group box. But if it get maximize still the same problem, that screen always run maximaze


why dont you just anchor it in the center, then unckeck rezize?
User is offlineProfile CardPM
+Quote Post

sraptor

RE: Center Buttons

30 Apr, 2009 - 11:14 AM
Post #5

New D.I.C Head
*

Joined: 22 Apr, 2009
Posts: 25



Thanked: 1 times
My Contributions
Because it is the main screen and look better maximize
User is offlineProfile CardPM
+Quote Post

egof

RE: Center Buttons

30 Apr, 2009 - 12:58 PM
Post #6

D.I.C Head
Group Icon

Joined: 27 Mar, 2009
Posts: 95



Thanked: 12 times
Dream Kudos: 100
My Contributions
CODE

    Private Sub Form1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize



    End Sub

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 05:09PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month