473,566 Members | 3,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't create a User Control

I'm trying to learn how to create a user control. As far as I can
understand, Visual Studio contains a template named "Windows Control
Library" to this end. However, this template is missing when I open the
"New Project" dialog in Visual C# 2005 Express Edition.

What I can do is add a "User Control" from the "Add New Item" dialog to my
Windows Application project. However, the created user control can only be
placed on forms within the project it was created.

What I want is to add the user control to the Toolbox window permanently for
use in other projects. However, I just can't find the dll file when I browse
for it in the "Choose Toolbox Items" dialog which I open by right clicking
in the Toolbox window.

What I can do is compile the user control generated files using the command
line compiler, but if I include any resources, such as images, I get a very
length error message when I try to place the user control on a form. (Maybe
I use the wrong command line compiler options?, I'm not an expert!)

So, is it possible to create user controls in the C# 2005 Express Edition
version, and if so, how can I go on? I'm stuck!

Any help or hints would be greatly appreciated!

Regards Carl Johansson
Dec 10 '07 #1
2 2036
So, is it possible to create user controls in the C# 2005 Express Edition

Yes; you simply need to create a dll. The easiest way (to get the
references setup) is to create a new windows forms application, and
then (in the properties dialog) change the output type to library.
Delete the form1 and program.cs that it supplies, and add your own
user-control(s). You should be able to use the IDE to setup your
images/resources etc.

When you've built it, note the file location; close it and start a new
winform app. Now use the toolbox to select items, and browse (on the
[first] .NET tab) to your compiled app. Your controls should appear.
Drop them on your form and you're sorted.

I've just tested this in Express and it worked fine.

Marc
Dec 10 '07 #2
(OP has indicated off-group that this is resolved)
Dec 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2018
by: Paul | last post by:
Hello everyone: I am developing a VB.Net Windows Application and I am now ready to create the deployment project for it. This application needs to be installable on a different number of users / clients, and the application has an Access DB out on their network. How can I create a deployment routine where I can have a dialog box prompt...
6
3684
by: Vinay | last post by:
Hi all, Can we create an ActiveX (.OCX) control in ATL project type? Is project type for creation of .OCX file can only be ActiveX MFC type? If yes, Could you suggest me some Links? My Requirement: To create an ActiveX control that could be include in a web Page. This control has a DataGrid on it. Iam unable to do so in MFC ActiveX...
3
9815
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has user interface. how should have get window handle from managed windows? Thanks in advance. Sushil
5
4845
by: Jonah Olsson | last post by:
Hello guys, I have an application which is built upon several user controls. That is, I have a default template (default.aspx) that I load a user control into (using placeholders in the template). Now, the template also contains a placeholder for buttons used by each user control. The current solution needs each user control to create its...
7
1638
by: Quentin Huo | last post by:
Hi: I created a web-form user control. And in client-site, there is a link which will create a Input element object when it is clicked. <script language=javascript> ....... var nameInput = document.createElement("input"); nameInput.setAttribute("id", "authorname");
2
2199
by: Quentin Huo | last post by:
Hi: I have a user control and I want to dynamically create a Label control and TextBox control when the button "add more author name" is clicked. I did like this: 1. there is a "PlaceHolder" control "ph" in the user control; 2. create a Label control and TextBox control when in the "add" button
5
1902
by: Just Me | last post by:
Given a button name Btn_5 and Index=5 I want to do something like dim zz as string = Btn_??Index??.Text or given an array of buttons, do:
10
1557
by: Miro | last post by:
I wanted certain text boxes ( only certain ones ) to always be Trim'd so that spaces are not in the begining, nor the end of the text entered. I created my own "Handle ?" - i hope thats the right terminology, and it works. Is this the right way to do this? I had to use DirectCast to get the textbox name. Private Sub TrimValues(ByVal...
10
2406
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's my question. Once the UserControl is dropped onto the container page, how can I perform some action on the codebehind of the container page from...
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.