|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
C#.Net 2003 - RadioButton Check validation
Hi there,
Need your help. Being a newbie using C#Net 2003, I am having problem trying to set his validation condition of 2 RadioButton check event. In VB6 or Vb.NET I will use this script below: If (RadioButton2.check <> true and RadioButton2.Check <> true ) then msgbox("Chick either RadioButton" ) Endif. ------------------------------------ In C#Net Script I am not sure how to duplicate the script. Please help me. Thanks.
__________________
Cheers, Lennie |
|
#2
|
|||
|
|||
|
This is the C++ forum, and while you may find some help here, the languages are fairly different (C# is not quite java, which is sorta borrowed from C++, so they are distant cousins).
in c++ its something more or less like: if( radio_variable.GetCheck() == false && !radio2.GetCheck() == false) { MsgBox("whatever"); } C# may or may not look like this, and GetCheck may not be exactly the function name but its close. I am pretty sure java and c++ use the same operators: == (is equal to?) != (is not equal to?) < > <= >= & (logical and) | (logical or) ^ (logical xor) && (boolean and) || (boolean or) etc Last edited by jonnin; 10-28-2009 at 09:21 AM. |
|
#3
|
|||
|
|||
|
Hi Jonnin,
Thank you very much for sharing your knowledge with me. I will try out your suggestion using C# to check it out. If it does work, I will post the script here to share with other Newbies like me learning C#. If it's Vb6 or VB.NET I got no problem with it. Thanks again for your help. You are just awesome. Glad to meet you at this Forum
__________________
Cheers, Lennie |
|
#4
|
||||
|
||||
|
For c# I believe this would do the trick
Code:
{
if (RadioButton1.Checked != true & RadioButton2.Checked != true) {
MessageBox.Show("You must select an option");
}
}
![]() As jonnin pointed out Quote:
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 Last edited by Hack; 10-29-2009 at 11:42 AM. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To add Action Pane in word 2003 using C#.Net | priya_shukla | .NET | 3 | 08-23-2008 07:42 AM |
| C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook | allbelonging | .NET | 0 | 02-13-2007 02:54 PM |
| Microsoft Visual C#.NET Step by Step 2003 | Manoj Agarwal | .NET | 1 | 04-18-2003 04:33 PM |
| validation check for selecting checkboxes or radio button | snz | ASP.NET | 0 | 07-05-2001 04:13 AM |
| Radiobutton and Check box | Frankie | ASP.NET | 3 | 08-06-2000 10:19 PM |