![]() |
| | #1 |
| Registered User Join Date: Sep 2006
Posts: 98
| Creating an object at run-time Thanks |
| Mavix is offline | |
| | #2 |
| Registered User Join Date: Sep 2006
Posts: 98
| BTW, I'm using Visual C# 2005 Express edition |
| Mavix is offline | |
| | #3 |
| Registered User Join Date: Jan 2003
Posts: 120
| like on a timer? or just from user interaction? like if you have only one button on your form, then when clicked it would create text boxes or other buttons? something like this? the easiest way is to right click on your InitializeComponent(); method in your main form and then go to "Go To Definition" and it will point you to the forms behind the scenes area. You can look at how things are created there like the definitions it sets like tab index, name, size, location, text and any listeners like Click or MouseMove in that area. Then you should use either this.Controls.Add(the button) like at the bottom of that function.
__________________ All Your Base Are Still Belong to Someone!!! And you Remember that!!! |
| AtomRiot is offline | |
| | #4 | |
| Registered User Join Date: Sep 2006
Posts: 98
| Quote:
| |
| Mavix is offline | |
| | #5 |
| Registered User Join Date: Jan 2003
Posts: 120
| well thats what i was confused about, you want to start with an empty form so you run the app and then have stuff appear later? or you just want to manually add all the controls in the code yourself without the help of the ide and then run the app?
__________________ All Your Base Are Still Belong to Someone!!! And you Remember that!!! |
| AtomRiot is offline | |
| | #6 |
| Registered User Join Date: Sep 2006
Posts: 98
| A mix of the two, actually. The form will start blank, and then at the beggining of the program some controls will be added, and then maybe later in the program some more. But not with a timer. |
| Mavix is offline | |
| | #7 |
| Registered User Join Date: Jan 2003
Posts: 120
| ok, i see. You just dont want the GUI portion to do everything for you. You want to handle everything past the creation of the form. in that case, i would make a test project and just drag some controls like buttons and whatnot onto your form, and then check out how it created them. That would give you a start. From there, you could go over to your app and put what you need in the form constructor and then handle the rest as you go.
__________________ All Your Base Are Still Belong to Someone!!! And you Remember that!!! |
| AtomRiot is offline | |
| | #8 | |
| Registered User Join Date: Sep 2006
Posts: 98
| Quote:
| |
| Mavix is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to time how long a program takes to run? | advancedk | C Programming | 2 | 08-18-2008 07:50 PM |
| Displaying Function Run Time | pf732k3 | C Programming | 1 | 03-21-2008 12:36 PM |
| Run time differences in Linux gcc versions | circuitbreaker | C++ Programming | 7 | 02-14-2008 11:09 PM |
| Please help - Run time error | barkercs | C Programming | 6 | 05-03-2006 11:15 AM |
| Create class at run time | muaed | A Brief History of Cprogramming.com | 3 | 04-11-2002 08:13 AM |