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 / .NET Framework / General / December 2005

Tip: Looking for answers? Try searching our database.

Docking and overlappping onrols

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
css - 28 Dec 2005 01:45 GMT
I had placed three controls on a UserControl and had them all perfectly
docked together filling up the UserControl.

I needed to add a fourth controls docked to the top.  So I dropped it on the
UserControl, changed the new control to Dock = top and changed the taborder
of all the other controls (bumped each up by 1) .  But when I start changing
the other controls back to dock = left, fill, etc... they expand the entire
height of the form making the top controls appear to overlap all the other
controls .  In a sense, the controls "slip" under the new 4th control.

If I were to remove them all and place new controls from scratch they all
appear fine and respect the control with the "Top" boundary - then it works
fine. But I would have to redo alot of settings if I took this route!!!

How can I make sure that any newly added controls dock appropriately with
the previous controls

Thanks
Sergey Poberezovskiy - 28 Dec 2005 02:25 GMT
I think I had a similar problem before - and it has something to do with the
order of the controls being added to a container.

In the "Windows Form Designer genereted code" locate the lines where the
controls in questions are added to the container, something similar to the

Me.Controls.Add(Me.myNewlyAddedControl) in VB,  or
this.Controls.Add(this.myNewlyAddedControl) in C#.

Then move this line of code prior to the other docked controls and switch to
design view - now your controls should appear as you wanted them to..

As far as I understand TabIndex has nothing to do with that, though it is
always good to set it right.

HTH

> I had placed three controls on a UserControl and had them all perfectly
> docked together filling up the UserControl.
[quoted text clipped - 14 lines]
>
> Thanks
css - 28 Dec 2005 03:15 GMT
Nope - that didn't work.  It must be something in the resx file.  
Sergey Poberezovskiy - 28 Dec 2005 04:02 GMT
I think that I had it wrong - instead of moving the line of the
NewelyAddedControl up - move it down - that should do it

> Nope - that didn't work.  It must be something in the resx file.  
Chris Dunaway - 28 Dec 2005 14:21 GMT
Try selecting the controls that are "under" the 4th control and
choosing "Bring To Front" for that control.  You can also experiment
with this on the other controls until you get them the way you want.
css - 28 Dec 2005 21:39 GMT
Chris,
That worked great.  I actually had to change the control by "send to back"

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.