Solved

Create run time buttons at runtime

Posted on 2016-11-18
8
29 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
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 28

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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.

713 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