User controls in Visual Studio 2013 Express? - c#

I cant find Windows Forms Control Library in my projecttemplates or in the "online"-option? Is it renamed or simply not included in Express version?
Edit:
Maybe Class library is what Im searching for? I want to create a user control for winforms, but that class library dont recognize winforms components and I cant use
using System.Windows.Forms
Can I do a work around in class library? Or do I need the full version of VS?

Class Library actually is what you need but it is better in your case to chose Winforms Program because that way all references are set up.
When you have created it change it's project type to class library in the properties tab.
Note: The using clauses just make it simpler to reference the classes in the assemblies they refer to. But to get access to these they first must be added to your project's references. Look at the project expolorer - references.
The Windows Forms Template has all necessary assemblies already there while the Class Library Template doesn't and only has the bare minimum you need to write non-visual classes.
You can always add more references as needed with a right-click on the project explorer. Then you can navigate to the assemblies you need, like in your case System.Windows.Forms
And no, you don't need the full version for most things.

From MSDN, you should be a able to find this option in Extensibility -> Installed templates.
In the New Project dialog box, under Installed Templates, expand the
node for your preferred programming language and then select
Extensibility. In the list of project types, select Windows Forms
Toolbox Control.

Related

Which project templates I can use to create a winform dll library?

Which project templates in visual studio are appropriate for creating a Winform dll libaray.
I want to use it for creating a plug-in interface window. I am looking for an alternative for WPF User Control Library in Wiforms.
Creating a Windows Forms Control Library is more suitable.
A project for creating controls to use in Windows Forms Applications
This way it adds windows forms related assemblies to the project and you don't need to add them yourself. It has these references additional to a Class Library project:
System.Drawing
System.Windows.Forms
If you open Add New Project dialog, you can find it in this path:
Visual C# > Windows Desktop > Windows Forms Control Library
Visual Basic > Windows Desktop > Windows Forms Control Library
Create a project using the project template Class Library
If you are looking to use WinForm classes in your library you are going to have to add the reference to System.Windows.Forms as this is not included by default in a Class Library project (they are generally used for utility functionality that doesn't require GUI elements) Not to say including GUI elements in a library is wrong, just uncommon, so they don't bother including it by default to cut down on dependencies.
To add System.Windows.Forms:
Solution Explorer -> Right Click References -> Add Reference -> Assemblies -> Framework
Then scroll until you find System.Windows.Forms, check it and click OK. You can now use WinForm objects in your library.
If you find yourself needing to test library GUI elements Windows Forms Control Library template project would probably be a better option
There is a similar template for Winforms called "Windows Forms Control Library". That's what you're looking for.
Btw you can just use "Class Library" template and add the Windows.Forms library references manually.
Only difference is that you can't run a class library project whereas you can run "Windows Forms Control Library" project where it displays UI to test your user controls.

Add a Web User Control to a Class Library Project in Visual Studio 2013

Can someone tell me how to make it so I have the ability to add WebUserControls (.asxc) to a Class Library project in Visual Studio 2013? I have search everywhere but only found how to do it in old versions.
As far as I can see, the Web Forms User Control item template doesn't get listed if the project is a Class Library. As a result, the easiest option may be to add a Web Forms project to your solution, add the User Control to it and then drag it into the Class Library project. You'd need to add the appropriate references to the Class Library project manually.

how to include XNA libraries in C# project?

I am trying to make a C# game. I want to include XNA libraries there (e.g. Microsoft.XNA.Framework.Graphics). But, if I do so, I get an error :
The type or namespace XNA doesnot exist in the namespace Microsoft.
Can anyone please help ?
First of all, check you are using the correct case, the namespace and assembly names are Xna not XNA. If that doesn't work:
You should follow the instructions here. These describe how to install (as well as some flavour of Visual Studio 2010) XNA Game Studio and to create a project using the template. Using the template project is much easier than adding the references manually.
To add a reference to the XNA assemblies, you need to right click your project in Solution Explorer in Visual Studio and select "Add Reference".
If you do not see the DLLs you are looking for, you may need to right click your project, select properties, and then ensure that the target framework is one of the flavours of the .NET 4.0 framework (for XNA 4.0).
First you should right click on the "References" folder shown (usually) at the top of the project you are working in. From here you can select add references and manually browse to the location of the XNA .DLLs.
First, you need to add a reference to the XNA binary files. Second, I recommend you start off with the Built-In Visual Studio XNA Game Template, and work from there.
To add the references manually, you'll (probably need XNA Game Studio installed) and then add references to Microsoft.Xna.Framework.dll and whatever else you need.
Personally, I still think you should start with the built-in visual studio template for a Game. Once you get a feel for it, move on to advanced concepts like embeding your game into a standard WinForm app or whatever.
In the solution explorer. Go to reference, add reference and then add th Microsoft.Xna.Framework.Xact reference 4.0 It is somewhere near the bottom if you leave it unsorted. Then you can access the Audio Engine class.
I had the same problem and then found it at the 3rd time of trying. Worked fine for me. Hope this helps.
Instead of hassling around in the references list in Visual Studio, just download the DLL from HERE, or the direct link:
https://www.dllme.com/dll/files/microsoft_xna_framework_dll.html

Visual studio how to get wpf and silverlight side by side

I have two projects in my solution one a silverlight library and the other a wpf control library, ive added the sources as a link from my silverlight library to my wpf library and after a bit of refatoring hit a road block, my wpf library project does not want to build the generated files needed for the code behind to recocnize the named elements from the xaml sources (which where added as links), does anyone know how to prompt visual studio 2008 to actually perform the gen operation on my linked sources?
Stab in the dark - but have you renamed a namespace or class name?
Make sure all the code/xaml namespace/class names are the same in wpf and silverlight versions.

Is it possible to add a New Project Wizard with a VSPackage?

I have a VSPackage for Visual Studio 2008 that I created for adding some editor and custom language functionality. I also have a need to add a new project/solution wizard to create a new Solution and a complex series of C++ projects to the solution. I know I can do this using a "Custom Wizard", but I would be much happier if I can implement this within my VSPackage using C# instead.
So I guess the main question is, is it possible to add an entry to the Project Types dialogs in Visual Studio from a VSPackage? Or is the "Custom Wizard" and JScript my only option here?
And if it's possible, where can I find information and/or samples on how to accomplish this?
To add an entry to the Project Types dialog, you need to install a project template (a zip file containing a .vstemplate file) as part of your installation. You will want to do this from your setup routine rather than from the VSPackage itself.
However, your .vstemplate can invoke a wizard written in C#. Although this is indeed a "custom wizard," you can provide a reference to a .NET assembly. There is no need to use a scripting language.
For an example, see IronPython > C# Example.IronPythonProject in the VS2008 SDK browser. Unfortunately this demonstrates only limited wizard functionality and only for project items rather than projects, but I hope it will be useful all the same.

Categories