Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1072093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:48:34+00:00 2026-05-16T20:48:34+00:00

The following works: If 1=1 rdoYes.checked = True Else rdoNo.checked = True End If

  • 0

The following works:

If 1=1
    rdoYes.checked = True
Else
    rdoNo.checked = True
End If

However, the following doesn’t work:

IIF(1=1, rdoYes.checked = True, rdoNo.checked = True)

Why is this?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:48:34+00:00Added an answer on May 16, 2026 at 8:48 pm

    It does “work”; it just doesn’t do what you want.

    IIf in VB.NET is a function (don’t use it, ever, by the way), which takes these parameters:

    1. A Boolean condition to check
    2. An Object to return if the condition is True
    3. A different Object to return if the condition is False

    In your usage, your condition is 1 = 1; then your two other parameters are rdoYes.Checked = True and rdoNo.Checked = True, both Boolean expressions from the VB compiler’s perspective (so, really, they’re equivalent to the simpler rdoYes.Checked and rdoNo.Checked).

    Remember that in VB.NET, the = sign is only an assignment if it is on its own line. This is how the compiler distinguishes between statements such as x = 5 and If x = 5 Then.

    This is not directly related to your question, but you should also be aware that IIf is deprecated and you should almost always favor If instead:

    ' Let us just suppose it made sense to write this: '
    ' Notice the If instead of IIf. '
    Dim result = If(1 = 1, rdoYes.Checked, rdoNo.Checked)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following works great (thanks to gracious assistance by this community!) Function RangeToArrayToRange(inputRange as
If the following works: alert( data.query.results.tbody[1].tr[0].td[0].span.img.src ); Why will this not work? var image
http://jsfiddle.net/WTELW/4/ The following works fine on JSFiddle, but doesn't seem to work right in
The following works fine: def self.already_joined?(days_event,user) already_joined=DaysEventsUser.where(:user_id=>user, :days_events_id=>days_event) if !already_joined.empty? return true end end
The following works, giving 3 points connected with a line. plot(c(1,7,12), c(0,0,2),type=b) However this
In my controller, the following works (prints oké) puts obj.inspect But this doesn't (renders
The following works: $user_list = new user_list(); $all_users_list = $user_list->getAllUsers(); The following doesn't work
The following works - returns Y when chargeback equal to 1 else it defaults
The following works in Chrome / FF etc... $('body').animate({scrollTop : 0}, 0); However, in
Why this code works? Does NHibernate employ object-interning? If not, the following works because

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.