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
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:
http://msdn.microsoft.com/en-us/subscriptions/bb514641.aspx
What is the difference between a User Control Library and a Custom Control Library?
http://msdn.microsoft.com/en-us/library/system.windows.controls.usercontrol.aspx
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/
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
Related
I am trying to use xander UI but I can not perform any action.
If I use metroUI then we write in code
class Form1: Metroframework.MetroForms.Forms
in place of class Form1:Forms
Then what can we do for Xander UI?
You can try the following steps to use XanderUI. It may be different from the metroUI.
First, you can download XanderUI.dll from the XanderUI. At the end of the article, you can download the dll.
Second, please create a winform app and add a tab in the toolbox.
Third, please right click the toolbox and select choose Items.
Fourth, choose the download the dll in the choose toolbox item window.
Fifth, you can see the control in the toolbox.
Finally, you can drag XUIObjectEllipse control first and then drag the XUIFromDesign control.
The following the final result:
I have a forms application and I do want a separate project for my one custom control that I need to use in 2 different places in my app.
I have have created a user control in the same project but I do not know how to use it in the program. It does not show up in the toolbox even if I drag it, it shows the drop cursor but then nothing happens. Will I have to use it manually ? or is there a better way.
Please help.
THanks,
In Tools -> Options, under the section for "Windows Forms Designer", ensure that AutoToolboxPopulate is True - then the toolbox should automatically populate with all user controls from all projects in the current solution.
I'm trying to learn how create a web user control so i can use in diffrent projects. I created a simple control just to see how it worked; after I created it, I could add it to any page on the current project and it worked fine.
My problem is how can I add this control to the tool box so I can use it in diffrent projects? I tried to look for him by doing:
right click toolbox > choose items > looking for it.
I can't see the control in the list.
What do i need to add so i can see it?
Here is the same question but nothing help me :( I'm using visual studio 2010.
Hey you have to create CustomControl instead of User Control
http://support.microsoft.com/kb/893667
I have several Visual Studio 2003 c# projects, each of them containing a "User Control" item where I read some input data from text boxes, perform some calculations when a button is clicked and display the results in text boxes. The outputs of these projects are dll files.
The thing is I would like to create a separate project with a TabControl item and add the "User Control" items from my existing projects as TabPages. It is important to keep intact the existing event handlers of my "User Control" items. The output of the resulting project should also be a dll file. How do I do it?
Maybe somebody knows a different way to obtain the same result?
Thank you very much!
Peter
If this is a winforms application, then you need to take a couple of steps:
1) Add references to each of the UserControl project DLLs to your application.
2) Add the controls to your tab pages. There are two options:
a) Add the control through code at run time.
b) Add the control to the form at design time (I prefer this method, but both are correct). To do this: open the form that you want to place the controls on, open the toolbox, if it isn't already, then drag each of the project DLLs onto the toolbox. This should create items in the toolbox to chose from that match your usercontrols. Create a tab for each user control, then drag the appropriate item from the toolbar to the tab; this should create the user control in the tab.
I have a class in an external library subclassing UserControl and set to public. Now I want to use this usercontrol in my main WinForms app. I have added this external library to the references of the main app, but the user control haven't appeard in the Toolbox - I have been told it should appear.
I am doing this for the first time. So, sorry if my question is too trivial.
Right click on the title panel, in the Toolbox, where you want the control.
Select Choose Items...
Click the Browse... button on the .NET Framework Components tab in the dialog that pops up (might take a few seconds for it to show)
Navigate to the external library, select the file and click Open.
All public controls from that library are now available for selection.
You can right click on your toolbox and add it from the context menu...
You can add items to the toolbox by right-clicking on it, "Choose Items...". Then go and get a coffee - it takes ages to load. Locate your dll.
Note that adding an item from the toolbox will automatically add the reference to the project.
Look under Tools->Options, navigate to Windows Forms Designer->General, and make sure "AutoToolboxPopulate" is set to true.
That's for VS 2008, but it should be in a similar place on earlier versions.
Note: I believe this may only work for your own projects. If it's referencing a compiled DLL, it may not get the controls from the DLL.