我是现在最大化按钮中click中添加如下代码
以下内容为程序代码:
1 static width As Integer = e.Form.BaseForm.width
2 static height As Integer = e.Form.BaseForm.height
3 static Top As Integer = e.Form.BaseForm.Top
4 static left As Integer = e.Form.BaseForm.left
5
6 If e.Form.BaseForm.left = 0 And e.Form.BaseForm.Top = 0 And e.Form.BaseForm.width = SysInfo.WorkingAreaWidth And e.Form.BaseForm.height = SysInfo.WorkingAreaHeight Then
7 e.Form.BaseForm.width = width
8 e.Form.BaseForm.height = height
9 e.Form.BaseForm.left = left
10 e.Form.BaseForm.Top = Top
11 'e.Form.BaseForm.WindowState = System.Windows.Forms.FormWindowState.Normal
12 Tables("车型资料").SetColVisibleWidth("车厂|98|车系|98|车型|290|前片_编码|120|后片_编码|120")
13 Else
14 e.Form.BaseForm.left = 0
15 e.Form.BaseForm.Top = 0
16 e.Form.BaseForm.width = SysInfo.WorkingAreaWidth
17 e.Form.BaseForm.height = SysInfo.WorkingAreaHeight
18 'e.Form.BaseForm.WindowState = System.Windows.Forms.FormWindowState.Maximized
19 Tables("车型资料").SetColVisibleWidth("车厂|98|车系|98|底盘轮毂|60|适用年份|100|车型|408|前片_编码|120|后片_编码|120")
20 End If
并在afterloda中加入
以下内容为程序代码:
1 Tables("车型资料").SetColVisibleWidth("车厂|98|车系|98|车型|290|前片_编码|120|后片_编码|120") '设置初始车型表列显示属性
这样,在加载窗口后显示的列是5列,然后点击最大化后,显示的列增加两列,再次点击最大化后,列又还原成5列,测试成功!不知道这个方法可好?有无弊端