2016-12-08 66 views
0

如果單選按鈕被選中,我希望能夠跳過模塊中的子程序。我已經四處搜尋,找不到辦法做到這一點..如果單選按鈕被選中,則跳過子程序

Private Sub RadioButton1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton1.CheckedChanged 
    If RadioButton1.Checked = True Then 
     Modify_PDF.add_watermark(source_file, source_file, "") 
    End If 

End Sub 

Private Sub RadioButton2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton2.CheckedChanged 

End Sub 

它基本上是與上述相反。如果選中radiobutton1,那麼它不應該運行add_watermark子例程。

任何幫助,不勝感激:-)

+0

你應該對你的按鈕的代碼單擊 –

+1

如果RadioButton1.Checked =假呢? –

+2

我認爲複選框「添加水印」是一個更好的選擇。 –

回答

0

試試這個:

Private Sub RadioButton1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton1.CheckedChanged 
    If Not RadioButton1.Checked Then 
     Modify_PDF.add_watermark(source_file, source_file, "") 
    End If 

End Sub 

Private Sub RadioButton2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton2.CheckedChanged 

End Sub 
相關問題