CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    114

    Question control with show method

    I want to create a composite control which will consist of several windows controls like buttons,text boxes and grid. I want my control to have a SHOW method , just like the Windows form control..so that if I write control.show, then it will pop up just like the form control.Can anyone help me.

  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: control with show method

    So you basically want your control to be a Windows Form? If so, use Windows Form to build your control.
    Good Luck,
    -Cool Bizs

  3. #3
    Join Date
    Mar 2004
    Posts
    114

    Re: control with show method

    But how to Add a form to a control...I tried it before...the form is placed seperately in the solution explorer. The user control1 and form are placed seperately.I want the form to be a part of the control.It will be a composite control consisting of a form , a datagrid and 2 buttons.And I want the control to have the show method just like the Form control, show that i can invoke it like control.show and the control will pop-up just like a form control.

  4. #4
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: control with show method

    Okay, I might not understand your problem exactly so bear w/ me.

    So, have built a usercontrol that is basically a FORM (inherited System.Windows.Form) and has bunch of other controls on it right?

    You want to add this user control into another control.

    Now, each CONTROL object has CONTROLS collection. So, what you have to do is instantiate your user control, and then add it into the controls collection of the control. Then calling SHOW() method of your usercontrol, should display it inside the host control.

    If you can, zip up your project (or part that is not working) and post it so that we can take a look at it.
    Good Luck,
    -Cool Bizs

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

Featured