Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all,

 

I have a form with 3 areas, which are 3 panels:

leftPanel, centerPanel and rightPanel.

 

The app creates userControls which are then

placed onto the panels with the call

this.centerPanel.Controls.Add(userControl)

for example.

 

Then I can call Show or Hide for each

userControl. So far it works fine.

 

BUT: Now I want to have overlapping panels.

But I don't know how to bring a userControl

to front, userControl.BringToFront() does

not work. Show() does not work either.

I tried both, but it doesnt work....

 

Any idea?

Greetings,

 

Toni.

Posted

Ok, I found the answer by myself:

 

The method bringToFront does only work

for the panel, because it contains the userControl.

 

For showing a particular userControl I must first

get the containing Panel and then...

 

Control panel = userControl.Parent;

panel.BringToFront();

userControl.Show();

Greetings,

 

Toni.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...