469,286 Members | 2,402 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

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 1360
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ryan Stewart | last post: by
7 posts views Thread by John | last post: by
3 posts views Thread by Andre Loker | last post: by
1 post views Thread by Krish | last post: by
5 posts views Thread by Sam | last post: by
2 posts views Thread by Istvan | last post: by
reply views Thread by jackob | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.