开发者

Prevent changes on radio button checked?

开发者 https://www.devze.com 2023-04-13 00:42 出处:网络
When i change the checked into another radio button, i wanna show a message and when user answers no, i want there will be any changing in my form but in my case i do get any changes.

When i change the checked into another radio button, i wanna show a message and when user answers no, i want there will be any changing in my form but in my case i do get any changes.

In a word., is there any way to prevent checked changes on radio button with message box?

here it is come of my code and i put it in event checked == false

If lblGrandTotal.Text <> "0" Then
      If MessageBox.Show("?", "Pertanyaan", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then
         rbPenjualan.Checked = True
         rbPenjualan.CausesValidation = False
      Else
        开发者_Go百科 lvNota.Clear()
         lblGrandTotal.Text = "0"
         statuscekjual = False
      End If
End If


You could try putting the code in the MouseDown event for the radio button.


You can handle CheckedChanged and check the button back conditionally

0

精彩评论

暂无评论...
验证码 换一张
取 消