Results 1 to 9 of 9

Thread: Container control?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    14

    Container control?

    Hi.

    I want to make a custom control where I can put other controls at design time.
    In vb6 I only had to change a property. But with VB 2005 Express I'm totally stuck.

    I already added this code:

    VB Code:
    1. <System.ComponentModel.Designer("System.Windows.Forms.Design.ParentControlDesigner,System.Design", GetType(System.ComponentModel.Design.IDesigner))> _
    2.  
    3. Public Class ExpandContainerNet
    4.  
    5. Inherits System.Windows.Forms.UserControl

    But then when I want to drop a control over my control it gets just behind it and not into the control. What I am missing?

    Thanks.
    Benedikt Bär (RDGS Project Lead) - www.relamp.tk

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    14

    Re: Container control?

    Anyone?

    Thanks very much.
    Benedikt Bär (RDGS Project Lead) - www.relamp.tk

  3. #3
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Container control?

    I didn't read the entire article, but it looks like this shoudl have the answer.
    http://www.codeproject.com/vb/net/Cu...nerControl.asp
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    14

    Re: Container control?

    Yes, I read this article. But doesn't help me. Sorry.



    I remember VB6.0 and how easy that was...
    Benedikt Bär (RDGS Project Lead) - www.relamp.tk

  5. #5
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Container control?

    Depending on what you are doing you could always inherit a container control, like the panel. That would allow you to add controls to it at design time.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  6. #6
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Container control?

    Or, just inherit Windows.Forms.ContainerControl. I just created a usercontrol inherited that, and it allows you to add controls at design time.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    14

    Re: Container control?

    Ok, I'll try that. Thank you very much.
    Benedikt Bär (RDGS Project Lead) - www.relamp.tk

  8. #8
    Addicted Member
    Join Date
    Jul 2006
    Posts
    219

    Re: Container control?

    i don't know if this is correct but try right clicking the container (in the form designer) and click send to back
    if this is right go to thread tools at the top of this page and mark this page resolved
    :-)

  9. #9
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Container control?

    Louix, that is not what beniwtv is asking. He is asking how to create a control that is like the panel, or groupbox where you can add controls to these controls. Z order doesn't have anything to do with it.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

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