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
  1. Home
  2. General Programming
  3. C#
  4. CButton::GetState in .NET?

CButton::GetState in .NET?

Scheduled Pinned Locked Moved C#
questioncsharphelp
6 Posts 3 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.
  • N Offline
    N Offline
    Nish Nishant
    wrote on last edited by
    #1

    What is the .NET equivalent for CButton::GetState? Any help is hugely appreciated. Thank you, Nish


    The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?

    N 1 Reply Last reply
    0
    • N Nish Nishant

      What is the .NET equivalent for CButton::GetState? Any help is hugely appreciated. Thank you, Nish


      The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      Nish, You can use the .Checked attribute

      		if(checkBox1.Checked)
      		{
      			MessageBox.Show("Checkbox1 is checked");
      		}
      
      		if (radioButton1.Checked)
      		{
      			MessageBox.Show("radioButton1 is checked");
      		}
      

      HTH Nick Parker This is a non-Calculus course as long as you know things like line integrals and surface integrals...

      J 1 Reply Last reply
      0
      • N Nick Parker

        Nish, You can use the .Checked attribute

        		if(checkBox1.Checked)
        		{
        			MessageBox.Show("Checkbox1 is checked");
        		}
        
        		if (radioButton1.Checked)
        		{
        			MessageBox.Show("radioButton1 is checked");
        		}
        

        HTH Nick Parker This is a non-Calculus course as long as you know things like line integrals and surface integrals...

        J Offline
        J Offline
        James T Johnson
        wrote on last edited by
        #3

        The GetState function he's looking at tells you if the button is currently in the 'clicked' state, when the mouse button is held down on top of it. The way to do this is to capture the mousedown/up events on the button and set a flag there. James Simplicity Rules!

        N 1 Reply Last reply
        0
        • J James T Johnson

          The GetState function he's looking at tells you if the button is currently in the 'clicked' state, when the mouse button is held down on top of it. The way to do this is to capture the mousedown/up events on the button and set a flag there. James Simplicity Rules!

          N Offline
          N Offline
          Nick Parker
          wrote on last edited by
          #4

          I was going off the definition that Microsoft shows for CButton::GetState at: CButton::GetState Microsoft says: Specifies the check state (radio buttons and check boxes only). A 0 indicates the button is unchecked. A 1 indicates the button is checked. A radio button is checked when it contains a bullet (•). A check box is checked when it contains an X. A 2 indicates the check state is indeterminate (three-state check boxes only). The state of a three-state check box is indeterminate when it contains a halftone pattern. I could have been wrong, just the way I understood it :) Nick Parker This is a non-Calculus course as long as you know things like line integrals and surface integrals...

          J 1 Reply Last reply
          0
          • N Nick Parker

            I was going off the definition that Microsoft shows for CButton::GetState at: CButton::GetState Microsoft says: Specifies the check state (radio buttons and check boxes only). A 0 indicates the button is unchecked. A 1 indicates the button is checked. A radio button is checked when it contains a bullet (•). A check box is checked when it contains an X. A 2 indicates the check state is indeterminate (three-state check boxes only). The state of a three-state check box is indeterminate when it contains a halftone pattern. I could have been wrong, just the way I understood it :) Nick Parker This is a non-Calculus course as long as you know things like line integrals and surface integrals...

            J Offline
            J Offline
            James T Johnson
            wrote on last edited by
            #5

            Yeah, thats when you pass in 0x003, Nish was looking for 0x004, the 'highlight state'; but he didn't mention that in the post I asked him that over sonork last night :-P James Simplicity Rules!

            N 1 Reply Last reply
            0
            • J James T Johnson

              Yeah, thats when you pass in 0x003, Nish was looking for 0x004, the 'highlight state'; but he didn't mention that in the post I asked him that over sonork last night :-P James Simplicity Rules!

              N Offline
              N Offline
              Nick Parker
              wrote on last edited by
              #6

              I knew I hadn't been that far off, thanks. :) Nick Parker This is a non-Calculus course as long as you know things like line integrals and surface integrals...

              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