Results 1 to 3 of 3

Thread: [RESOLVED] Possible to create a custom control made from several controls?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    477

    Resolved [RESOLVED] Possible to create a custom control made from several controls?

    I know how to create custom controls using "Inherits" and extending that single control to add or change functionality. I also know how to add controls at run time. What I am wondering though, is it possible to create a single control that is comprised of multiple controls (a GroupBox containing a TextBox, two Labels, and three small Images, all with preset positions), so that rather than having to add 7 controls individually at run time, I can just add the custom GroupBox and all of the rest are automatically added and positioned? If so, how?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,682

    Re: Possible to create a custom control made from several controls?

    What you want is a User Control, which you can add via the Project menu.

    You can position controls (and write code) as if it is a form, and then when you Build the project it will be added to the Toolbox so that you can put it on forms.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    477

    Re: Possible to create a custom control made from several controls?

    Quote Originally Posted by si_the_geek View Post
    What you want is a User Control, which you can add via the Project menu.

    You can position controls (and write code) as if it is a form, and then when you Build the project it will be added to the Toolbox so that you can put it on forms.
    Thank you, that was exactly what I needed. Never used that before. Learn something new everyday.

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