Showing a Control underneath another Control

G

Guest

Hello all. I am interested in hiding a ListView Control underneath a
TabControl. The ListView Control will contain say, 5 columns. When the user
selects 1 of the tabs, I want to show the ListView and 3 columns (the other 2
will be hidden). When the user selects the other tab, I want to show the
other 2 columns of the ListView. Is there a way to do this without creating
two ListViews? I have tried using all the Focus, Selected, and Show
functionalities to the hidden ListView, but it will not appear over the
TabControl.

Thanks for the help.
 
D

Dave Sexton

Hi StyrofoamSUV,

If you are using Visual Studio .NET make sure that the hidden Control has
the following aspects:

1. Add the Control to the Form, or at least the parent Control of the
TabControl. If the ListView is contained by a TabPage then it may only be
visible when that TabPage is selected.
2. Right-mouse click the control at design-time and select Bring-To-Front.
3. Ensure that the Control's Visible property is true and run the program.
You should see the Control over all other Controls on the same Form.
4. Set the Control's Visible property to false so that the Control is hidden
when the Form is displayed.
5. In code toggle the visibility of the Control using the Visible property.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top