•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 426,346 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,349 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 14562 | Replies: 4
•
•
Join Date: Jun 2005
Posts: 69
Reputation:
Rep Power: 4
Solved Threads: 0
I want to allow the user to tell me how many rows and columns of buttons to draw. Then draw the buttons. When a button is clicked, it displays the row # and column # of that button in a msgbox.
I would create a button using the following code:
Button myText = new Button();
myText.Location = new Point(25,35);
myText.Text = "First";
this.Controls.Add (myText);
First of all, how would I create a click event if the button name isn't available until runtime? If a button is created in the design view, to get the click event one would double-click on the button.
Would I need a 2d array to store the column/row numbers to retrieve. But how would I know which button is clicked to retrieve the info?
Thanks.
I would create a button using the following code:
Button myText = new Button();
myText.Location = new Point(25,35);
myText.Text = "First";
this.Controls.Add (myText);
First of all, how would I create a click event if the button name isn't available until runtime? If a button is created in the design view, to get the click event one would double-click on the button.
Would I need a 2d array to store the column/row numbers to retrieve. But how would I know which button is clicked to retrieve the info?
Thanks.
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Create control at runtime (ASP.NET)
- create aspx page in runtime (C#)
- How to create a database during the runtime in VB6?! (Visual Basic 4 / 5 / 6)
- Buttons created dynamically VS. events (Python)
- rubber banding and tracking linked image boxes linked by rubber bands (VB.NET)
- Java GUI--Dynamically Adding Buttons to a Menu (Java)
- how to create new table in MS Access2003 using VB6 (Community Introductions)
Other Threads in the C# Forum
- Previous Thread: drag multiple rows
- Next Thread: Adding items to a combo box related to data selected in another combo box



Threaded Mode