我做了一个按钮1,如果你点击它,它就会启动计时器。在 timer_tick 中,我输入了 Label7.Text = "LOADIN G"。我也做了退出(Button2)。我想做一个代码,如果 Label7.Text = "LOADIN G" 那么 button2 中的 msgboxresult.no 将是 Button1.Enabled = True 。这是我想如何做到这一点的视频:http ://www.youtube.com/watch?v=4URYhd0xA8I&feature=youtu.be
这是Button2(退出)的代码
Dim msg As String
Dim title As String
Dim style As MsgBoxStyle
Dim response As MsgBoxResult
msg = "Are you sure you want to exit?" ' Define message for exit."
style = MsgBoxStyle.DefaultButton2 Or _
MsgBoxStyle.Question Or MsgBoxStyle.YesNo
title = "Exit"
' Display message.
response = MsgBox(msg, style, title)
If response = MsgBoxResult.No Then
If Label7.Text = "L O A D I N G" Then
Button1.Enabled = True
Button5.Enabled = False
TextBox1.Enabled = True
End If
End If
If response = MsgBoxResult.Yes Then
Me.Close()
End If
我可以简单地做:
If response = MsgBoxResult.No Then
Button1.Enabled = True
但重要的是还提到了 label7,因为 label7 在 timer1 启动时出现。请帮助我不知道发生了什么。