如果複選框未勾選,爲什麼文本框內的文本不會更改?如果沒有選中,那麼文本框的文本應該有「-g no」,但是當Command1被點擊時它不會改變。任何解決方案可能有些非常簡單的事情,但我只是沒有成功。 :\VB6爲什麼這不會改變? [複選框和文本框]
我的代碼:
Private Sub Command1_Click()
If Check1.Enabled = True Then
If TextPass.Text = "" Then
Text1.Text = "-o " & TextPool.Text & ":" & TextPort.Text & " -u " & TextUser.Text & " -g yes " & "-t " & Combo1.ListIndex
Else
Text1.Text = "-o " & TextPool.Text & ":" & TextPort.Text & " -u " & TextUser.Text & " -p " & TextPass.Text & " -g yes " & "-t " & Combo1.ListIndex
End If
Else
If TextPass.Text = "" Then
Text1.Text = "-o " & TextPool.Text & ":" & TextPort.Text & " -u " & TextUser.Text & " -g no " & "-t " & Combo1.ListIndex
Else
Text1.Text = "-o " & TextPool.Text & ":" & TextPort.Text & " -u " & TextUser.Text & " -p " & TextPass.Text & " -g no " & "-t " & Combo1.ListIndex
End If
End If
End Sub
幫助表示讚賞!或者只是修復我的代碼。
這是行不通的。你測試過了嗎? 「未找到方法或數據成員」。 Check1.Check是否存在? :O – user2404495
沒有測試。這就是我一直檢查是否檢查複選框的方式。用不同的選項編輯我的答案。 – jonhopkins
工作,非常感謝! :) – user2404495