By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,330 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

Drag a splitter by coding

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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.