Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. why wrong radioButton method is invoched=

why wrong radioButton method is invoched=

Scheduled Pinned Locked Moved C#
jsonhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    merh
    wrote on last edited by
    #1

    Hi, I have 10 radioButtons and when I first time select radioButton1 on GUI everthying works well, I see the method radioButton1_CheckedChanged_1 has been invocked. But after when I select radioButton2 I see first that the radioButton1_CheckedChanged_1 has been invocked an after that radioButton2_CheckedChanged_1 and same behaviour for the rest of radio buttons. Can somebody help me with the isuue that when I select a radio button then the right radiobutton method is going to be invocked. Thanks in advanced mehran

    C 1 Reply Last reply
    0
    • M merh

      Hi, I have 10 radioButtons and when I first time select radioButton1 on GUI everthying works well, I see the method radioButton1_CheckedChanged_1 has been invocked. But after when I select radioButton2 I see first that the radioButton1_CheckedChanged_1 has been invocked an after that radioButton2_CheckedChanged_1 and same behaviour for the rest of radio buttons. Can somebody help me with the isuue that when I select a radio button then the right radiobutton method is going to be invocked. Thanks in advanced mehran

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The event is called 'checkedchanged', it's working as advertised. When radio1 unchecks, the check has changed, so the event is called. The object passed into the method is the control that raised the event, so you can use that to check if the control is checked or unchecked ( or when you have one event per control, you can access it directly )

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      M 1 Reply Last reply
      0
      • C Christian Graus

        The event is called 'checkedchanged', it's working as advertised. When radio1 unchecks, the check has changed, so the event is called. The object passed into the method is the control that raised the event, so you can use that to check if the control is checked or unchecked ( or when you have one event per control, you can access it directly )

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        M Offline
        M Offline
        merh
        wrote on last edited by
        #3

        Thanks.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups