How to Overlap User Controls in Windows Application?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • samueltilden@gmail.com

    How to Overlap User Controls in Windows Application?

    I know the answer is simple ... as soon as I find it.

    I have a Windows Application in which I want to display a different
    User Control in the bottom part of the form depending on the
    functionality chosen by the user.

    I have made several User Controls and they now show up in my toolbox.

    How do I put them all on the bottom part of the form (including
    docking) and make only one visible when needed?

    Thanks.
  • =?Utf-8?B?UGV0ZXIgUml0Y2hpZSBbQyMgTVZQXQ==?=

    #2
    RE: How to Overlap User Controls in Windows Application?

    I usually use a Panel for this. You can easily hide/show an entire panel.
    The trick is dealing with these panels in the Designer.
    --
    Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.

    Microsoft MVP, Visual Developer - Visual C#


    "samueltilden@g mail.com" wrote:
    I know the answer is simple ... as soon as I find it.
    >
    I have a Windows Application in which I want to display a different
    User Control in the bottom part of the form depending on the
    functionality chosen by the user.
    >
    I have made several User Controls and they now show up in my toolbox.
    >
    How do I put them all on the bottom part of the form (including
    docking) and make only one visible when needed?
    >
    Thanks.
    >

    Comment

    • Peter Duniho

      #3
      Re: How to Overlap User Controls in Windows Application?

      On Wed, 30 Apr 2008 07:32:32 -0700, <samueltilden@g mail.comwrote:
      I know the answer is simple ... as soon as I find it.
      >
      I have a Windows Application in which I want to display a different
      User Control in the bottom part of the form depending on the
      functionality chosen by the user.
      >
      I have made several User Controls and they now show up in my toolbox.
      >
      How do I put them all on the bottom part of the form (including
      docking) and make only one visible when needed?
      Just drag them all into your form. You can initialize them all with the
      Visible property as "false". Or if you have one that you want to be
      visible by default, leave that one's Visible property as "true".

      You can use the Tab key in Visual Studio to change the currently selected
      control, once one control is selected. This is very useful when you have
      multiple overlapping controls that make it impossible to actually click on
      one or more that's under another control.

      You could do the same thing putting them into a Panel I suppose, as Peter
      R. suggests. But I'm not sure why you'd bother, since a UserControl is
      pretty similar to a Panel anyway. You can show and hide individual
      UserControls just as easily as a Panel that contains a UserControl.

      Pete

      Comment

      Working...