Private Sub Form_Load() '窗体启动时将按钮设为无效
Command1.Enabled = False
End Sub
Private Sub Text1_Change()
If Len(Text1) > 1 Then Command1.Enabled = True
'当文本框中有内容时将按钮设为有效
End Sub
text1_change_sub
if text1.text<> "" then command1.enabel=true else command1.e=f
sub
自己稍加修改