Location of panels with splitters

I have a layout question with TPanels and TcxSplitter from DevExpress. panellayout http://pp.kpnet.fi/bengtsson/temp/layout.png

The main form has several panels from A to G. A - F is assembled in one ABCDEF panel. ABCDEF contains 3 panels: AB, CDE and F. The CDE panel contains a CD panel.

Between all the borders between the panels there is DevExpress's TcxSplitter. The problem is that the user can take the splitter between ABCDEF and G and move it to the left so that it reaches the AB panel and the CDE panel of the cover. I do not want to allow this.

Instead, I want the CDE panel to have a minimum width of 5 pixels. Then the width of the panel AB must be compressed. Hope I explained quite well :) I tried to set the .minwidth = 5 limit on the CDE panel, but the panel can still be hidden. Maybe Devexpress has a good solution for this?

Hi

+4
source share
2 answers

cxSplitter has the MinSize property, which I see in the test application, it is respected when resizing. Since there is only one MinSize property, it is checked on the panel on both sides of the separator, so you cannot specify at least 50 pixels for one side and 100 for the panel on the other side of the separator. Verify that the AutoSnap property is false.

But Splitter also has an OnCanResize event, so you can also prevent resizing.

Also, since you are using devex, I would suggest using either dockSite / dockPanel or LayoutControl v2 instead of a simple Delphi TPanel.

+2
source

Try this property

cxSplitter1.ResizeUpdate:=True; 
+1
source

Source: https://habr.com/ru/post/1301790/


All Articles