-- 作者:douglas738888
-- 发布时间:2018/11/23 10:47:00
-- 模拟菜单收缩的问题
请教老师,下面代码写在窗口全局事件CLICK,打开窗口后,所有按钮下的PANEL都是打开的,只有点击按钮才能收缩起来
想实现:打开窗口后所有BUTTON下的PANEL都收缩起来,只显示BUTTON(这里不想使用QQ菜单的方式进行收缩)
我在窗口AFTERLOAD写入模拟点击按钮的代码,打开窗口后无法全部把PANEL收缩起来,只能收缩一部分,但是点击BUTTON(决策阶段,设计阶段...)都能正常收缩PANEL
Select Case e.Sender.Name Case "Button1","Button2","Button3" Dim Pnl As WinForm.Panel = e.Form.Controls("Panel" & e.sender.name.Replace("Button", "")) Pnl.Top = e.Sender.Top + e.Sender.Height + 1 Pnl.Visible = Not Pnl.Visible Dim Lbl As WinForm.Button = e.Form.Controls("Button1") For i As Integer = 2 To 3 Pnl = e.Form.Controls("Panel" & i - 1) e.Form.Controls("Button" & i).Top = IIF(Pnl.Visible,Pnl.Top + Pnl.Height + 1,Lbl.Top + Lbl.Height + 1) Lbl = e.Form.Controls("Button" & i) e.Form.Controls("Panel" & i).Top = Lbl.Top + Lbl.Height + 1 Next End Select 此主题相关图片如下:无标题.jpg
[此贴子已经被作者于2018/11/23 10:48:52编辑过]
|