以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]窗口最小化时提示出错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=117592) |
-- 作者:天一生水 -- 发布时间:2018/4/15 18:02:00 -- [求助]窗口最小化时提示出错 窗口最小化时提示:SplitterDistance 必须在 Panel1MinSize 和 Width - Panel2MinSize 之间。 在SizeChanged加个判断不起作用。 If e.Form.BaseForm.windowstate = 1 Then \'最小化时判断 Return Else \'分区面板比例 Dim sp As WinForm.SplitContainer = e.Form.Controls("SplitContainer1") sp.SplitterDistance = sp.Width * 0.5 Dim sp1 As WinForm.SplitContainer = e.Form.Controls("SplitContainer3") sp1.SplitterDistance = sp1.Height * 0.5 End If |
-- 作者:有点甜 -- 发布时间:2018/4/15 18:11:00 -- 试试
If e.Form.BaseForm.windowstate = 1 Then \'最小化时判断
Return
Else
\'分区面板比例
If sp.Width >= 10 AndAlso sp.Height >= 10 Then
Dim sp As WinForm.SplitContainer = e.Form.Controls("SplitContainer1")
sp.SplitterDistance = sp.Width * 0.5
Dim sp1 As WinForm.SplitContainer = e.Form.Controls("SplitContainer3")
sp1.SplitterDistance = sp1.Height * 0.5
End If
End If |
-- 作者:天一生水 -- 发布时间:2018/4/15 18:49:00 -- 谢谢老师!没问题啦 If e.Form.BaseForm.windowstate = 1 Then \'最小化时判断 Return Else \'分区面板比例 Dim sp As WinForm.SplitContainer = e.Form.Controls("SplitContainer1") If sp.Width >= 10 AndAlso sp.Height >= 10 Then sp.SplitterDistance = sp.Width * 0.5 End If Dim sp1 As WinForm.SplitContainer = e.Form.Controls("SplitContainer3") If sp1.Width >= 10 AndAlso sp1.Height >= 10 Then sp1.SplitterDistance = sp1.Height * 0.5 End If End If [此贴子已经被作者于2018/4/15 18:49:42编辑过]
|