-
Jun 4th, 2012, 05:49 PM
#1
Thread Starter
Addicted Member
Adding buttons at runtime
Hey, im just wondering if i can make a user control in Expression blend (a button) and add it to my form dynamically at runtime but with changes such as the button.content.
Thanks, Tim
-
Jun 4th, 2012, 06:13 PM
#2
Re: Adding buttons at runtime
I don't know what Expression blend is but you can create any control dynamically and add it to a container like a Form or GroupBox at runtime by using the container's Controls property.
-
Jun 4th, 2012, 06:24 PM
#3
Thread Starter
Addicted Member
Re: Adding buttons at runtime
Expression Blend is just a nice program that helps you design better WPF applications then visual studio.
I was going to add the buttons to a panel but im not sure what you mean by the container's Controls property.
Thanks, Tim
-
Jun 4th, 2012, 07:24 PM
#4
Re: Adding buttons at runtime
Unfortunately, I don't know anything about WPF. Windows Forms have a Controls property which is basically a collection that works like any collection. You can add, remove and clear stuff from it. As a matter of fact, all controls in a Windows Forms application have such a property.
-
Jun 5th, 2012, 10:44 AM
#5
Thread Starter
Addicted Member
Re: Adding buttons at runtime
Yes i now understand i can add buttons dynamically like this
Dim btn As New Button
Controls.Add(btn)
however i want to add custom buttons i have made in expression blend in the same way i did a default button above.
i dont know if it helps but the button i made in expression blend opens in visual studio as file called "newbutton.xaml"
-
Jun 5th, 2012, 04:52 PM
#6
Re: Adding buttons at runtime
This should actually be in the WPF section... I'll ask a mod to move it...
-tg
-
Jun 6th, 2012, 06:38 AM
#7
Re: Adding buttons at runtime
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
|