Custom splitter bars

S

Stephen Haunts

Hi

I've created a usercontrol that extends the standard splitter bar. What ive
done is put a button in the middle of the splitter, that when pressed,
collapses the splitter to were its docked, kinda like in dreamweaver.

When i try to reposition the splitter using splitter.Location.X for example
i get the following error:

Editor.cs(1245): Cannot modify the return value of
'System.Windows.Forms.Control.Location' because it is not a variable

But if i change the s.SplitPosition property, it kinds of works, but when
i restore the splitter it seems to either be +/- a bit from the intended
value. for exmple if the dock position is to the left, when i restore the
splitter to say X,265, it will put it to 320 instead.

How do i change the position of the splitter correctly from a usercontrol.

Regards

Steve
 
G

Guest

Try to alter the entire Location rather than just X, by doing something like

spliter.Location = new Point(newX, spliter.Location.Y)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top