Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > .NET

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-28-2009, 02:34 AM
Lennie Lennie is offline
Registered User
 
Join Date: Jan 2005
Location: New Zealand
Posts: 201
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
Reply With Quote
  #2  
Old 10-28-2009, 09:18 AM
jonnin jonnin is offline
Senior Member
 
Join Date: Dec 2003
Posts: 3,008
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.
Reply With Quote
  #3  
Old 10-29-2009, 01:29 AM
Lennie Lennie is offline
Registered User
 
Join Date: Jan 2005
Location: New Zealand
Posts: 201
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
Reply With Quote
  #4  
Old 10-29-2009, 11:38 AM
Hack's Avatar
Hack Hack is offline
Super Moderator
 
Join Date: Apr 2007
Location: Sterling Heights, Michigan
Posts: 7,719
For c# I believe this would do the trick
Code:
{ 
    if (RadioButton1.Checked != true & RadioButton2.Checked != true) { 
        MessageBox.Show("You must select an option"); 
    } 
}
Also, C# questions are better suited for the .NET section so I'm moving it here, and ask that you post any further questions in C# in this section.

As jonnin pointed out
Quote:
Originally Posted by jonnin
This is the C++ forum, and while you may find some help here, the languages are fairly different
What works in C++ may not work at all in C#
__________________
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.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT -4. The time now is 07:51 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.