Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have problems and unresolved, I would like to make a button aligned to 5 lines.
How vb code set position button?

illustration like:

button1 button2 button3 button4 button5


Hope you can help me
Posted
Comments
Sergey Alexandrovich Kryukov 5-Jan-15 23:14pm    
Button? Okay, no problem. But first, please tell us: which one? Full type name, please. There are several unrelated types using the simple name "Button".
Short answer is: most probably, this is the property "Location", but this is a bad way of aligning things. You need to learn layout for the UI library you are using.
—SA
ulungss 6-Jan-15 1:46am    
i have some code like :

For i = 1 To 5
newButton = New Windows.Forms.Button
newButton.Name = "btnButton" & i
newButton.Text = "Button" & i
newButton.Top = 20 + i * 30
newButton.Left = 40
newButton.BackColor = Color.Green
newButton.Cursor = Cursors.Hand
Next

This code produces vertical button from the top down, but I want the button horizontally from left to right.

i hope you can help me.

and my qustion

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900