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
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.
Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | Create Sortable BindingList(not mine) | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. -jmcilhinney
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.
Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | Create Sortable BindingList(not mine) | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. -jmcilhinney
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
* I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
*Proof positive that searching the forums does work: View Thread *
* How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
* How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
* Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
"There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN
Moved to the WPF forum.
Joacim Andersson
Microsoft MVP, MCSD, MCSE, Sun Certified Java Programmer
If anyone's answer has helped you, please show your appreciation by rating that answer.
I'd rather run ScriptBrix...
Joacim's view on stuff.