Solved

Create run time buttons at runtime

Posted on 2016-11-18
8
24 Views
Last Modified: 2016-11-23
Hello,
How do I create run time buttons placed one below the other.

Cheers
0
Comment
Question by:RIAS
  • 5
  • 2
8 Comments
 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41892767
Hi Rias,
Can you please explain more?
0
 

Accepted Solution

by:
RIAS earned 0 total points
ID: 41892768
Pawan,
Found the solution:

  Dim newButton = New Button()

                ' Add some properties, etc. to the button
                newButton.Text = "Liils : " & IntPositionNumber
                newButton.Location = New Point(739, 67 + int)
                newButton.Size = Me.btnIetails.Size
                Me.Controls.Add(newButton)
                int += 25
0
 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41892769
Great ! good one !!
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 27

Expert Comment

by:Ark
ID: 41895176
I suggest using flowlayoutpanel:
FlowLayoutPanel1.FlowDirection = FlowDirection.TopDown
For i = 1 To 25
    FlowLayoutPanel1.Controls.Add(New Button With {.Text = "Button_" & i})
 Next

Open in new window

1
 

Author Comment

by:RIAS
ID: 41895235
Hello Ark,

Will try your solution.
0
 

Author Comment

by:RIAS
ID: 41895236
Thanks!
0
 

Author Comment

by:RIAS
ID: 41895238
Moderator,

Can I accept Ark's Solution.
0
 

Author Closing Comment

by:RIAS
ID: 41898886
Found the solution.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question