Windows应用程序中的TableLayoutPanel问题 [英] problem with TableLayoutPanel in Windows Application

查看:115
本文介绍了Windows应用程序中的TableLayoutPanel问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI
我使用的是内部使用用户控件的一个MDI表单,其中创建了TableLayoutPanel
这里的问题是,每当我调整MDI窗体窗口的大小时,所有控件都没有通过将Dock属性设置为FILL并保持锚定为Top,Left

HI
i am using one MDI form inside that i used User Controls in that i created TableLayoutPanel
here the problem is whenever i am resizing the MDI form window all the controls are not resizing by making dock property to FILL and keeping anchor to Top,Left

推荐答案

这些问题以及我的一些应用程序.这并不是解决问题的理想方法,但是您应该尝试添加自己的锚定".

为此,您可以使用MDI窗体上的Resize事件并将某些计算应用于控件.

小例子:

I had these issues aswell with some of my applications. It''s not really an ideal way to solving the problem but you should try adding your own "Anchoring".

To do this you can use the Resize event on the MDI form and apply some calculations to your controls.

Little example:

TextBox textBox1 = new TextBox();
textBox1.Size = new Size(mdiForm.Size.Width - 20, 25);



这样,当调整MDI表单的大小时,控件也将随之调整.再次,不是理想的..但是这就是我修复"它的方式.



That way when the MDI form is being resized so will the controls. Again, not ideal.. but this is how i "fixed" it.


这篇关于Windows应用程序中的TableLayoutPanel问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆