User Controls

This is a discussion on User Controls within the Windows Programming forums, part of the Platform Specific Boards category; Hello, I wanted to create a custom control in Visual Studio, and then add it as a component to a ...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    4

    User Controls

    Hello,

    I wanted to create a custom control in Visual Studio, and then add it as a component to a Windows Form. So, I added a new "User Control" to the project, and edited it by dragging and dropping buttons, labels etc. Then, I want to be able to add this control to a form.

    I've been told that I needed to build the project, and then add the .dll for the control to the toolbox items. So, I built the project, and then did Tools->Choose Toolbox Items. Here, I browsed through my project directory, and found the .exe for the project, which was found in MyProject\Debug. After this, my user control appeared in the list of toolbox items, with a gear wheel symbol next to it.

    So, I then dragged this user control into my Windows form, but the control does not actually appear on the form. It doesn't give me any errors when I drag and drop, but the control is not added to the window, and does not appear in the source code for the form.

    So I have done something wrong....one thing I notice is that I added the .exe for the project (MyProject\Debug\MyProject.exe) rather than a .dll for the user control, which is what I was looking for - but couldn't find one anywhere, despite having built the entire project.

    Any ideas?? Thanks!

  2. #2
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    just a guess. you may have to export the resource code from your visual resource editor and manually past that code in to your program. the same way i had to with the borland resource visual editor. meow.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help managing user input
    By JayDiddums10 in forum C Programming
    Replies: 2
    Last Post: 11-19-2006, 05:01 PM
  2. placing user controls in a form...
    By AngKar in forum C# Programming
    Replies: 2
    Last Post: 07-21-2006, 05:02 PM
  3. pass error before char
    By bazzano in forum C Programming
    Replies: 3
    Last Post: 03-26-2006, 12:00 PM
  4. ~ User Input script help~
    By indy in forum C Programming
    Replies: 4
    Last Post: 12-02-2003, 06:01 AM
  5. Stopping a user from typeing.
    By knave in forum C++ Programming
    Replies: 4
    Last Post: 09-10-2001, 01:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21