以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  帮忙翻译下这是什么意思  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=93817)

--  作者:神一样的男人
--  发布时间:2016/12/7 20:05:00
--  帮忙翻译下这是什么意思

\'Dim WinF As WinForm.Form = Args(0)
\'Dim But As WinForm.Button = Args(1)
\'Dim ButCount As Integer = Args(2)
\'Dim Pan0 As WinForm.Panel = WinF.Controls("Panel0")
\'Dim Int As Integer = Val(But.Name)
\'Dim Top As Integer
\'Dim ButHeight As Integer = But.Height
\'For i As Integer = 1 To ButCount
    \'Dim Pan As WinForm.Panel = WinF.Controls("Panel" & i)
    \'Pan.Top = -1+Top
    \'If int = i Then
        \'If i = 1 Then
            \'Pan.Height = Pan0.Height-ButHeight*(ButCount-Int)-Top+1
        \'Else
            \'Pan.Height = Pan0.Height-ButHeight*(ButCount-Int)-Top
        \'End If       
    \'Else
        \'Pan.Height = ButHeight  
    \'End If
    \'Top += Pan.Height-1
\'Next

 

帮忙翻译下这是什么意思


--  作者:有点蓝
--  发布时间:2016/12/7 20:58:00
--  

\'Dim WinF As WinForm.Form = Args(0)
\'Dim But As WinForm.Button = Args(1)点击的按钮,名称按顺序定义为为1、2、3、......

‘Dim ButCount As Integer = Args(2)按钮的数量

\'Dim Pan0 As WinForm.Panel = WinF.Controls("Panel0") 包含所有按钮和隐藏显示的panel的容器
\'Dim Int As Integer = Val(But.Name)
\'Dim Top As Integer 
\'Dim ButHeight As Integer = But.Height 按钮的高度
\'For i As Integer = 1 To ButCount 循环所有按钮
    \'Dim Pan As WinForm.Panel = WinF.Controls("Panel" & i)获取按钮对应的panel
    \'Pan.Top = -1+Top设置顶部距离=按钮顶部距离
    \'If int = i Then 如果这个按钮是点击的按钮
        \'If i = 1 Then 如果是第一个按钮
            \'Pan.Height = Pan0.Height-ButHeight*(ButCount-Int)-Top+1 设置panel的高度等于容器的高度减去控件上面的按钮个数*按钮高度
        \'Else
            \'Pan.Height = Pan0.Height-ButHeight*(ButCount-Int)-Top
        \'End If        
    \'Else
        \'Pan.Height = ButHeight   ‘如果不是点击的按钮,把panel高度设置为和按钮高度一致,相当隐藏按钮
    \'End If
    \'Top += Pan.Height-1设置下一个按钮的顶部距离
\'Next