查看: 470  |  回复: 0
  VB6 禁用窗体上所有控件
楼主
发表于 2023年4月19日 16:36

新建From1(窗体),新建Command1(按钮CommandButton),代码:

Private Sub Command1_Click()
    Dim i As Integer
    For i = 0 To Form1.Controls.count - 1
        Form1.Controls(i).Enabled = False
    Next i

End Sub


Private Sub Command1_Click()
    Dim ctrTemp As Control
    For Each ctrTemp In Me.Controls
        ctrTemp.Enabled = False
    Next
End Sub


您需要登录后才可以回帖 登录 | 立即注册
【本版规则】请勿发表违反国家法律的内容,否则会被冻结账号和删贴。
用户名: 立即注册
密码:
2020-2024 MaNongKu.com