473,386 Members | 1,673 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,386 software developers and data experts.

Drag a splitter by coding

Hi,

Does anyone know how to drag a splitter by coding.

I will put three controls on form1,two panels and a splitter. The first
panel's dock property is set to top, the splitter's dock is also top and the
second panel's dock is fill. Now I want to expand the first panel's area and
shrink the second panel by draging the splitter in code but failed.
Thanks in advance

Peter
Nov 21 '05 #1
4 1537
Hi Peter,

the splitter's location is based on the size of the controls that are above
or left of it.
So you'll have to resize the panel that's docked top.
For example:

Panel1.Size = New Size(Panel1.Size.Width, Panel1.Size.Height + 20)

hth Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Peter" <zl*****@sina.com> schreef in bericht
news:#4**************@TK2MSFTNGP09.phx.gbl...
Hi,

Does anyone know how to drag a splitter by coding.

I will put three controls on form1,two panels and a splitter. The first
panel's dock property is set to top, the splitter's dock is also top and the second panel's dock is fill. Now I want to expand the first panel's area and shrink the second panel by draging the splitter in code but failed.
Thanks in advance

Peter

Nov 21 '05 #2
Peter,

If you want to see the code, than just drag a splitter on your form and open
the little plus before the designer created code.

In most cases the code is wonderfull made, in some cases it looks a little
bit overdone (however that has mostly a very well reason when you overthink
it why they did it that way).

I hope this helps,

Cor
Nov 21 '05 #3
"Peter" <zl*****@sina.com> schrieb

Does anyone know how to drag a splitter by coding.

I will put three controls on form1,two panels and a splitter. The
first panel's dock property is set to top, the splitter's dock is
also top and the second panel's dock is fill. Now I want to expand
the first panel's area and shrink the second panel by draging the
splitter in code but failed.

What does "drag by coding" mean? Start the drag operation and the user still
has to move it, or set the position by code? I assume the latter: Set the
Splitter's Splitposition property.

Armin

Nov 21 '05 #4
Armin,changing splitter's Splitposition can solve my problem. Thanks you all
..

Peter
Nov 21 '05 #5

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

Similar topics

1
by: Ryan Stewart | last post by:
If you don't want to read this post because of its length, I understand. I've spent two and a half days on this problem and have a good deal of information to relate. And this is kind of a long...
7
by: John | last post by:
Hi, I have a group of controls in a panel on the right-hand side of a splitter and a treeview on the left-hand side. The only configuration that I can find to make the right-hand side resize...
3
by: Andre Loker | last post by:
Hi! For my current application I'm looking for a four-way-(cross) splitter control (as often seen in 3D-editors). The .NET Splitter-class is (IIRC) only a two-way splitter. Does anyone know such...
1
by: Krish | last post by:
This is my first try with C# windows gui devlopment, is it correct to say that gui development in C# is windows forms. I would like to create a form with two sections, 2 datagrids, I would like...
5
by: Sam | last post by:
Hi, I have a panel docked to the bottom of my form. This panel can be expanded vertically by clicking on a button. When the user click on the button again, the panel is then collapsed. The panel...
2
by: Istvan | last post by:
Hello ....Window.Forms.... Can somebody help me with Panels and Splitters ? I want to add three Panels to one Usercontrol , between them with two movable Splitter. First Row: 2...
2
by: eric dexter | last post by:
I am trying to steal this code from the wxpython demo but it appears that mb comes from nowhere and I am having errors because of it import wx ...
1
by: JDeats | last post by:
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)...
0
by: jackob | last post by:
hello, i have an urgent case, i wanna know how to drag and drop panels created dynamically inside a big panel?? here's below the code i make but it didn't work : plz if anyone can help me ... ...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...

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.