Results 1 to 20 of 20

Thread: Components

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Components

    I have a component (class library) project in vb.net.
    I added a new project to the solution and added a reference to the component.
    Now, I want to be able to add that component onto a form so that it will appear in the panel beneath the form. Just like when you add a ado.net connection control.
    How do I do that????? I thought it would appear in the toolbox but it doesn't.
    Don't anthropomorphize computers -- they hate it

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    right click on the toolbox. Select Customize Toolbox.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    I don't see customize toolbox. I only have add/remove items.
    That is what's odd to me. Shouldn't that component appear in the add/remove window?
    Don't anthropomorphize computers -- they hate it

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    What version of Visual Studio are you using?
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    .NET 1.1 or 2003
    Don't anthropomorphize computers -- they hate it

  6. #6
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    I guess thay may have changed it then. so I have no clue.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  7. #7
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Did you browse for your dll in the Add/Remove dialog? Or are you expecting it to just show up? Most of the time I have found that I need to point to the dll and then the controls show up.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  8. #8

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Yeah, I know that problem. I'm referencing a project though. I have the container project along with the tester in teh same solution for debugging purposes.
    Don't anthropomorphize computers -- they hate it

  9. #9
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    so what you are saying is your usercontrol is not a design time on the form user control, but more like a tooltip control, or contextmenu control?

    i noticed you said class library... is it? or is it a control library?

  10. #10

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    it's a component class library as it includes a timer.
    I want it to add as a component to my tester project.
    Don't anthropomorphize computers -- they hate it

  11. #11
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    sorry maybe im just totally confused... if you go to new project, did you pick "Class Library" or "Windows Control Library"

    I don't see any "component class library"

  12. #12

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    sorry, it's a class library.
    Don't anthropomorphize computers -- they hate it

  13. #13
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    im not positive, but to get it to show up in the components, or toolbox, it needs to actually contain a component in it... or be a control library, if it is just a class, you can't add it there

  14. #14

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    But it does. The class contains a timer component.
    Don't anthropomorphize computers -- they hate it

  15. #15
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Oh I think I get it now. The problem isnt that you cant add a compiled component to the toolbox, its you cant add a component project to it like you can with REferences right?
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  16. #16

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    I'm not sure I know what you mean.
    I have the class library with a timer in it.

    I have added another project to the solution and referenced the class library project in the new project.

    I can create the object in code no problem.

    I want to be able to include it in the testing app as a component.
    Hope that clears things up a bit more.

    Thanks,
    Don't anthropomorphize computers -- they hate it

  17. #17
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    The class has to inherit ComponentModel.Component and then be added to toolbox.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  18. #18
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    i think the problem is that it just isnt a component.. its a class.. if the class inherited from the timer class, then it would be a component and it would be able to be added... if you change a class into a component via inheritence, the icon for the .vb file changes.. that is the only way I have done it... so I am not sure if your way is possible.. see the picture
    Attached Images Attached Images  

  19. #19

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    This is the heading of the class

    VB Code:
    1. Public Class FootPedal
    2.     Inherits System.ComponentModel.Component
    3.  
    4. ''this is more down where the timer code is
    5.  
    6.  Private components As System.ComponentModel.IContainer
    7.     Friend WithEvents tmrPortQuery As System.Windows.Forms.Timer
    8.  
    9.     ' ===================================
    10.     ' Interval merely sets and returns the tmrPortQuery.Interval
    11.     '  property.
    12.     ' ===================================
    13.     <DefaultValue(100), _
    14.      Description("Automated polling interval."), _
    15.      Category("Behavior")> _
    16.     Public Property Interval() As Integer
    Don't anthropomorphize computers -- they hate it

  20. #20
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Then compile it and use the Add/REmove for the toolbox then you can drag it onto the form.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width