vb.net - what exception rule to use with unselected radio buttons to produce exception dialog -


I am trying to generate an error exception when the user has not selected an option with the radio buttons beside me The exception message box does not exist. I'm not getting any coding errors as the syntax is recovering, just so that the code does not produce the desired process.

  Try SelectedServiceDeciaml = CostSelectedService TotalDecimal = SelectedServiceDeciaml + TotalDecimal AmountAllServicesTextBox2.Text = TotalDecimal .ToString ("C") Catching DiscountException as ArgumentException (Discount10RadioButton5.Checked = False andalso Discount20RadioButton6.Checked = false andalso NoDiscountRadioButton7.Checked = false) MessageBox.Show ( "should be an exemption amount selected." "data entry error", MessageBoxButtons.OK, MessageBoxIcon.Information) NoDiscountRadioButton7 .Focus () attempts ended with .Select (with) the end in  

you create a custom exception to your case Does not need to, but if you want to create a custom exception, then I will create a new class that was created in class: System.Exception . I can give you an example for you think you want to go that route.

  Try SelectedServiceDeciaml = CostSelectedService TotalDecimal = SelectedServiceDeciaml + TotalDecimal AmountAllServicesTextBox2.Text = TotalDecimal.ToString ("C") if (Discount10RadioButton5. Checked = incorrect and also discount 20RadioButton6.Checked = False andAlso NoDiscountRadioButton7.Checked = False) then MessageBox.Show ( "must choose a discount amount.", "data entry error", MessageBoxButtons.OK, MessageBoxIcon.Information) with NoDiscountRadioButton7. Focus () .Select () End If Catch went to MessageBox.Show ( "an error as the former exception ... Here is the error:" & amp; ex.ToString) try to end  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -