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
Printable View
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
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.
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
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.
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"
This should actually be in the WPF section... I'll ask a mod to move it...
-tg
Moved to the WPF forum.