FrickX
FrickX

Reputation: 63

Create own toolbox element in VS 2012 .Net-Framework 4 (c#)

is there any possibility to create your own button as toolbox element (for other projects) in Visual Studio 2012 (version 11.0.50727.1)?

I just need a button (like the button from iTunes) for another project. (Tutorials are also welcome).

WPF

Upvotes: 1

Views: 1398

Answers (3)

Mark Hall
Mark Hall

Reputation: 54532

Since this ended up being Wpf, I believe the easist way to go would be to create a WpfControlLibrary that is used for UserControls that way it would be easier for you to customize the look and feel of your Button. It can also be added to your ToolBox by right clicking on your ToolBox and Selecting Choose Items then Select WpfComponents and Browse to your Dll.

See these Links:

  1. http://msdn.microsoft.com/en-us/subscriptions/bb514641.aspx
  2. What is the difference between a User Control Library and a Custom Control Library?
  3. http://msdn.microsoft.com/en-us/library/system.windows.controls.usercontrol.aspx

Upvotes: 1

Stephen Hewlett
Stephen Hewlett

Reputation: 2445

I'm assuming you are talking about a WPF button. If it's for one extra project, you are perhaps best off creating a button style in a seperate XAML resource file and reusing that file in the second project. If you need to create a reusable control to the extent that you need a button for it in the VS toolbox, then see here: http://msdn.microsoft.com/en-us/library/ee712573.aspx

Upvotes: 0

farfareast
farfareast

Reputation: 2309

You will need to create a custom control for your button and compile it into a separate dll. Then add this control from this dll to the toolbox.

See for example here: http://dhavalupadhyaya.wordpress.com/2008/07/20/how-to-add-custom-control-in-visual-studio-toolbox/

Upvotes: 0

Related Questions