Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Placing a control above another control;.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ketaki - 07 Mar 2008 06:56 GMT
Hello,
   I am new to C# and I am facing a problem. I have two user
controls.First control has an image which is loaded. And the second
control is supposed to be placed on the first control. But when the
first control is invalidated the second control gets hidden behind the
first control and it becomes invisible. Once I invalidate the second
control it appears on top of the first control for fraction of second
and again gets hidden. I want the second control to be seen
permanently on the first control even wheen the first control is
invalidated. I tried "Send to back" and "Bring to front" options but
they do not seem to be solving my problem.
Please help.
Thanks
Michael Nemtsev [MVP] - 07 Mar 2008 07:17 GMT
Hello ketaki,

asp.net or winforms?!

---
WBR,
Michael  Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour 

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

k> Hello,
k> I am new to C# and I am facing a problem. I have two user
k> controls.First control has an image which is loaded. And the second
k> control is supposed to be placed on the first control. But when the
k> first control is invalidated the second control gets hidden behind
k> the
k> first control and it becomes invisible. Once I invalidate the second
k> control it appears on top of the first control for fraction of second
k> and again gets hidden. I want the second control to be seen
k> permanently on the first control even wheen the first control is
k> invalidated. I tried "Send to back" and "Bring to front" options but
k> they do not seem to be solving my problem.
k> Please help.
k> Thanks
ketaki - 07 Mar 2008 12:11 GMT
Hello,
It is winforms.
Peter Duniho - 07 Mar 2008 18:13 GMT
> [...] I want the second control to be seen
> permanently on the first control even wheen the first control is
> invalidated. I tried "Send to back" and "Bring to front" options but
> they do not seem to be solving my problem.

You should post a concise-but-complete sample of code that reliably  
demonstrates the problem.  There's just not enough specific information in  
your question for anyone to understand for sure just how you are putting  
your form and its controls together.

That said, some things that may be useful to you: controls are ordered  
visually according to their order in the Controls property of the parent  
control, with the first control (0 index) being on top.  Also, controls  
that act as containers can wind up with other controls added to same form  
as their children, depending on where those other controls were placed.  A  
child control will obscure a parent control no matter what you do with the  
z-order.

Usually this sort of thing would show up right away.  After all, the first  
thing that happens before you ever see a form is that it's invalidated and  
requires painting.  If the only thing causing your issue was in fact  
invalidation (i.e. calling Invalidate()), it seems odd that it would  
happen only after the form was first shown, as your message implies.

But then, your question was presented in a pretty vague way.  So who knows  
what's really going on except you.  That's why a concise-but-complete  
sample would be useful.

Pete

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.