473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How do I dynamically resize portion of form with WinForms splitter control on it.

I have a simple WinForm with a WinForms splitter down the middle. I
would like to make it so when the user clicks on a button inside the
left portion of the screen (the panel to the splitters left) that
portion of the form is reduced in size by about 90% (I want to shrink
this area of the of the form).

The splitter doesn't appear to have any methods for programmatic
resizing, I tried changing it's width settings and the splitter moved
without moving the controls inside it.

Mar 9 '07 #1
1 6000
On Mar 9, 1:00 pm, "JDeats" <Jeremy.De...@gmail.comwrote:
I have a simple WinForm with a WinForms splitter down the middle. I
would like to make it so when the user clicks on a button inside the
left portion of the screen (the panel to the splitters left) that
portion of the form is reduced in size by about 90% (I want to shrink
this area of the of the form).

The splitter doesn't appear to have any methods for programmatic
resizing, I tried changing it's width settings and the splitter moved
without moving the controls inside it.
To resize a Splitter you can use the Splitters "SplitPosition"
attribute. You can increase or decrease this value to move the
splitter different directions depending on how it is docked to your
form. If you want to reduce a panel that is controlled by a splitter
by 90% I would do the following.

splitter1.SplitPosition = (int)((double)splitter1.SplitPosition * .1);

and that will reduce it by 90% assuming this isn't less than the
MinSize of the splitter. Let me know if you have any problems using
this code.

~ Justin Creasy
www.immergetech.com
www.immergecomm.com

Mar 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Owen Jenkins | last post by:
I have tried to resize a snapshot control on a form but it seems not to work. I can resize the width by clicking the maximize button with the following code in the Resize event....
2
by: Noah Coad [C# MCP] | last post by:
I'm creating a program the must show the time (a clock) in a user control and the text must fill the user control. How do I make text dynamically resize to fill a label/panel/usercontrol? ...
4
by: BBM | last post by:
I'm trying to set up a form with two panels divided by a Splitter control. I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to...
1
by: Dave Taylor | last post by:
I have a StatusBar control docked to the bottom of the screen, a horizontal splitter control just above that, and then a DataGrid control that has its docking property set to Fill above that. (I'm...
1
by: Mamatha | last post by:
Hi I have an application in VB.NET,in that application one form contains listbox(on the leftside of the form)and datagrid control(on the rightside of the form).Both controls displays data at...
5
by: Dennis | last post by:
I trying to understand how to have a column spliter cursor with a dashed line drawn down indicating the current size of the column depending on where the splitter cursor is. I want this to be like...
6
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I want to implement the following: If the user clicks on the border of a form, then I want to show a box around the form that represents the form's bounds. As the user moves the mouse only the...
9
by: Marky1124 | last post by:
Hi, I am hoping that someone can offer me some advise. I am new to CSS layouts and I've struggled to produce the screen layout that I wanted. Here's my demonstration page:- ...
10
by: =?Utf-8?B?UmljaA==?= | last post by:
A lot of users at my workplace use different screen resolutions, and I build apps to use 1680 x 1050 pixels res by default. But some users are using 800 x 600, and the apps are too large for their...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.