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 / Windows Forms / WinForm General / January 2005

Tip: Looking for answers? Try searching our database.

Can I make a splitter stay centered using the Form designer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Teis Draiby - 14 Jan 2005 08:02 GMT
In a window containing two controls divided by a splitter, I want this
splitter to stay centered when the window is resized.

Is there any trick to do this in the Windows Form Designer or do I have to
implement this programatically?

Regards, Teis
Bob Powell [MVP] - 14 Jan 2005 11:18 GMT
You need to implement this programmatically by calculating the position in
the OnSizeChanged override or SizeChanged event.

If the user is not supposed to touch it it's probably best not even to use a
splitter but just calculate the positions and sizes of the controls either
side of the centre.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> In a window containing two controls divided by a splitter, I want this
> splitter to stay centered when the window is resized.
[quoted text clipped - 3 lines]
>
> Regards, Teis
Teis Draiby - 14 Jan 2005 12:48 GMT
Yes, I want the user to be able to move the splitter.
Why? Is there any disadvantages using splitters that I should know of?
Performance issues e.g..

> You need to implement this programmatically by calculating the position in
> the OnSizeChanged override or SizeChanged event.
>
> If the user is not supposed to touch it it's probably best not even to use a
> splitter but just calculate the positions and sizes of the controls either
> side of the centre.

"Teis Draiby" wrote:
> > In a window containing two controls divided by a splitter, I want this
> > splitter to stay centered when the window is resized.
> >
> > Is there any trick to do this in the Windows Form Designer or do I have to
> > implement this programatically?
Bob Powell [MVP] - 14 Jan 2005 14:07 GMT
> Why? Is there any disadvantages using splitters that I should know of?
> Performance issues e.g..

No. I wondered why you wanted to have a splitter and automatically
reposition it to the center of the form. I figured one or the other but not
both.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Yes, I want the user to be able to move the splitter.
> Why? Is there any disadvantages using splitters that I should know of?
[quoted text clipped - 18 lines]
> to
>> > implement this programatically?
Teis Draiby - 14 Jan 2005 15:13 GMT
Ah! Sorry,
what I need is to scale both controls equally. I just wanted to make the
question more eh... clear.

Thanks, Teis

> No. I wondered why you wanted to have a splitter and automatically
> reposition it to the center of the form. I figured one or the other but not
> both.

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.