0
我在製作故障排除程序。到目前爲止,我有以下代碼:如何在視覺基礎知識中製作故障排除程序?
Public Class speakers
Dim currentq As Integer
Dim Q1 As String = "Does sound play?"
Dim Q2 As String = "Has the sound got too much bass or treble?"
Dim Q3 As String = "Is the sound too loud or quiet?"
Dim Q4 As String = "Is sound distorted?"
Dim Q5 As String = ""
Dim Q6 As String = ""
Dim Q7 As String = ""
Dim Q8 As String = ""
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If currentq = 0 Then
Label1.Text = Q1
currentq = 1
ElseIf currentq = 1 Then
Label1.Text = Q2
currentq = 2
ElseIf currentq = 2 Then
Label1.Text = Q3
currentq = 3
ElseIf currentq = 3 Then
Label1.Text = Q4
currentq = 4
ElseIf currentq = 4 Then
Label1.Text = Q5
currentq = 5
ElseIf currentq = 5 Then
Label1.Text = Q6
currentq = 6
ElseIf currentq = 6 Then
Label1.Text =
currentq = 7
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
currentq = currentq + 1
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Controls.Clear()
InitializeComponent()
Me.Hide()
Form1.Show()
End Sub
End Class
你會如何做一個標籤改變一個問題到另一個當你點擊是或否按鈕
是的,我是新來的吧。感謝您的建議 –
代碼可以在許多方面進行修改,將做同樣的工作,也歡迎^^ – bigworld12