473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 2009
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
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...
6
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...
3
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...
5
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...
7
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 =...
2
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...
5
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
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...
10
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.