|
-
December 19th, 2009, 10:59 AM
#1
Create Buttons and Forms at runtime!
I have to create buttons,forms at runtime after reading XML file.
XML file will contain numbers of buttons and froms which i have to create run time.
Please let me know right way.
-
December 19th, 2009, 06:02 PM
#2
Re: Create Buttons and Forms at runtime!
Why don't ya try and attempt it first.
Create a program to read an xml file and retrieve the number of buttons you want to create.
At runtime, create a new System.Windows.Form. Add a button to the Form, and Show() the Form.
-
December 20th, 2009, 10:57 AM
#3
Re: Create Buttons and Forms at runtime!
Check out xaml - it's what it does.
-
December 20th, 2009, 02:05 PM
#4
Re: Create Buttons and Forms at runtime!
well just to give this dude some stuff he wants,
Declare a button, label, textbox w/e, set it's properties and then add to the form.
so here is a button example
Button myButton = new Button();
myButton.Name = "btnMyButton";
myButton.Text = "My Button";
myButton.Size = new System.Drawing.Size(100, 20);
myButton.Location = new System.Drawing.Point(this.Width - 150, this.Height - 125);
this.Controls.Add(myButton);
myButton.Show();
myButton.BringToFront();
Hope this is a good enough example that sets you on your way to create w/e you need 
ClayC
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|