views:

289

answers:

2

I have a question about layout with TPanels and TcxSplitter from DevExpress. panellayout

The main form has some panels A to G. A - F is collected in one panel ABCDEF. ABCDEF contains 3 panels: AB, CDE and F. Panel CDE contains panel CD.

Between all limits between panels there are a TcxSplitter from DevExpress. The problem is that the user can take the splitter between ABCDEF and G and move it to left so it reach panel AB and cover panel CDE. I don't want to allow that.

Instead I want panel CDE have a minimum width of say 5 pixels. Then the width of panel AB should be shrinked. Hopefully I explained good enough :) I have tried to set a constraint.minwidth = 5 on panel CDE but the panel can still be hided. Maybe Devexpress have some nice solution for this ?

Regards

+1  A: 

Try this property

cxSplitter1.ResizeUpdate:=True;
Emin_As
+2  A: 

cxSplitter has MinSize property, from what I see in a test app, it is respected when resizing. Since there is only 1 MinSize property, it is checked for panels on either side of splitter, so you can't specify say 50 pixels minimum for one side and 100 for the panel on the other side of the splitter. Make sure the AutoSnap property is false though.

But there is also a OnCanResize event on the splitter, so you can prevent resize there as well.

Also, since you're using devex I would suggest you use either dockSite/dockPanel or LayoutControl v2 instead of plain Delphi TPanel.

Daniel Maurić
I use the OnCanResize event and prevent resizing over the limit. Thanks!
Roland Bengtsson