有这样一段代码,因为本人刚学VB不久,所以不明白它是什么意思.有哪位高手帮忙解释一下啊,谢谢!
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If Shift = 6 Then
        If Not txtCode.Visible Then
            frmMain.Height = 7260
            txtCode.Visible = True
        Else
            frmMain.Height = 3300
            txtCode.Visible = False
        End If
    End If
End Sub
尽量详细一些,谢谢!!

解决方案 »

  1.   

    就是捕捉form的按钮按下的事件根据功能键 Shift = 6(需要试试看是哪个键)的时候就就根据txtcode这个textbox是否显示来改变frmMain窗体的高度
      

  2.   


    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) 
    If Shift = 6 Then 'SHIFT ,CTRL 和 ALT 键这些位分别对应于值 1、2 和 4,shift=6就是在窗口上同时按下Ctrl+Alt键
            If Not txtCode.Visible Then '如果TXTCODE控件(应该是个文本框)Visible 属性不为真.即不可见
                frmMain.Height = 7260 '改变frmmain窗口高度
                txtCode.Visible = True '设置Txtcode控件为可视
            Else 
                frmMain.Height = 3300 改变frmmain窗口高度
                txtCode.Visible = False '设置Txtcode控件为不可见        End If 
        End If 
    End Sub