1状态栏的设置
平时我们开发C#winform时状态栏有不填充满的状态,这是可以通过在statusStrip中插入空白段,并设置spring为true来实现对齐和填充。spring属性为是否填充状态栏。
2 窗口参数单向传递
窗口参数可以重载构造函数进行参数单向传递。在主窗口使用如下代码
subMain ua = new subMain (this.current);
在子窗口使用重载构造函数完成传递。
public subMain(int user)
{
InitializeComponent();
current = user;
}
3 窗口参数回传
窗口参数回传主窗口设置public变量
public partial class main: Form
{
public int current= 0;
在子窗口中采用this.owner属性进行变量回传。
main m= (main)this.Owner;
m.current= this.current;