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. ReadOnly Radio Button?

ReadOnly Radio Button?

Scheduled Pinned Locked Moved C#
helptutorialquestion
10 Posts 4 Posters 1 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.
  • R Offline
    R Offline
    rich_wenger
    wrote on last edited by
    #1

    Hi, Anybody have any ideas on how to best emulate a 'ReadOnly' capability for a radio button? Any help greatly appreciated.

    C 1 Reply Last reply
    0
    • R rich_wenger

      Hi, Anybody have any ideas on how to best emulate a 'ReadOnly' capability for a radio button? Any help greatly appreciated.

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Enabled = false


      My: Blog | Photos "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious

      R 1 Reply Last reply
      0
      • C Colin Angus Mackay

        Enabled = false


        My: Blog | Photos "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious

        R Offline
        R Offline
        rich_wenger
        wrote on last edited by
        #3

        I'm doing that already. Looks like sh*t.

        K D 2 Replies Last reply
        0
        • R rich_wenger

          I'm doing that already. Looks like sh*t.

          K Offline
          K Offline
          Kamrul Hasan
          wrote on last edited by
          #4

          Your problem statement is not clear. Can you explain it a bit more ?

          R 1 Reply Last reply
          0
          • K Kamrul Hasan

            Your problem statement is not clear. Can you explain it a bit more ?

            R Offline
            R Offline
            rich_wenger
            wrote on last edited by
            #5

            Hi, Thanks for your interest. I have a data application in which some boolean choices as represented by radio button pairs and at certain points in the application I am representing the data to the user in ReadOnly TextBoxes where applicable. I would like to emulate this functionality in a representation of the RadioButton and am looking for a path of least resistance to accomplish this task. Any help would be greatly appreciated.

            1 Reply Last reply
            0
            • R rich_wenger

              I'm doing that already. Looks like sh*t.

              D Offline
              D Offline
              Dan Neely
              wrote on last edited by
              #6

              Change the font color back to black after disabling the button?

              R 1 Reply Last reply
              0
              • D Dan Neely

                Change the font color back to black after disabling the button?

                R Offline
                R Offline
                rich_wenger
                wrote on last edited by
                #7

                I've taken a different approach by building my own custom control that inherits from System.Windows.Forms.RadioButton NameSpace. I'm using GDI+ to alter the presentation of the interface based off a boolean public property I've exposed called 'ReadOnly'. I'm still trying to workout how to cancel 'Click' the click event. Any help would be greatly appreciated.

                K 1 Reply Last reply
                0
                • R rich_wenger

                  I've taken a different approach by building my own custom control that inherits from System.Windows.Forms.RadioButton NameSpace. I'm using GDI+ to alter the presentation of the interface based off a boolean public property I've exposed called 'ReadOnly'. I'm still trying to workout how to cancel 'Click' the click event. Any help would be greatly appreciated.

                  K Offline
                  K Offline
                  Kamrul Hasan
                  wrote on last edited by
                  #8

                  You can stop the click Event by overriding the OnClick method in RadioButton class and Removing the call to the base class. like: protected override void OnClick(System.EventArgs e) { //base.OnClick (e); } -- modified at 12:27 Monday 14th November, 2005

                  R 1 Reply Last reply
                  0
                  • K Kamrul Hasan

                    You can stop the click Event by overriding the OnClick method in RadioButton class and Removing the call to the base class. like: protected override void OnClick(System.EventArgs e) { //base.OnClick (e); } -- modified at 12:27 Monday 14th November, 2005

                    R Offline
                    R Offline
                    rich_wenger
                    wrote on last edited by
                    #9

                    Hi, and thanks for your interest. I tried your suggestion but when I tried to build the control I received an error 'RadioButtonRocLib.RadioButtonRoc.onclick(System.EventArgs)': no suitable method found to override".

                    K 1 Reply Last reply
                    0
                    • R rich_wenger

                      Hi, and thanks for your interest. I tried your suggestion but when I tried to build the control I received an error 'RadioButtonRocLib.RadioButtonRoc.onclick(System.EventArgs)': no suitable method found to override".

                      K Offline
                      K Offline
                      Kamrul Hasan
                      wrote on last edited by
                      #10

                      correct code is: protected override void OnClick(System.EventArgs e) { //base.OnClick(e); } Here 'OnClick''s 'O' and 'C' character should be in upper case. I don't know why it is not shown correctly.

                      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