简体   繁体   中英

Different design time/Runtime WinForms control behaviour

I am building an app that uses some built in and some 3rd party controls (DevExpress).

Inside the designer, everything looks OK, however while running the app, some controls are placed wrong.

Are there any easy ways to debug this issue?

More specifically, i have a container that holds 2 controls in it. These controls should stack nicely together one on top of the other (indeed it looks like that in the Designer).

While running the app, one control is displayed on top of the other blocking it (see attached image). 在此处输入图片说明

Another weird thing is that some properties of the 2 controls that get overlapped are not updated with respect to their visual status.

this means that a control has a Location of (0, 300) but in fact appears to be in (0, 0).

As a workaround, you could place the two controls in the two panels of a SplitContainer and dock (fill) them there. This has also the advantage that the users can resize the controls.

Another alternative is the TableLayoutPanel .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM