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. Windows Forms
  4. How to work with ToggleButton

How to work with ToggleButton

Scheduled Pinned Locked Moved Windows Forms
helptutorialquestion
4 Posts 3 Posters 20 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.
  • P Offline
    P Offline
    pashitech
    wrote on last edited by
    #1

    Hi all, Please tell me how to work with ToggleButton I need to use two buttons- if i select one the other should be desibled,vice versa. Hope u got my question.-Just a sample Toggle Button. Please help me. pashi

    prashanth, s/w Engineer, Syfnosys.

    N 1 Reply Last reply
    0
    • P pashitech

      Hi all, Please tell me how to work with ToggleButton I need to use two buttons- if i select one the other should be desibled,vice versa. Hope u got my question.-Just a sample Toggle Button. Please help me. pashi

      prashanth, s/w Engineer, Syfnosys.

      N Offline
      N Offline
      Newbie00
      wrote on last edited by
      #2

      I don't see any logic here. You want to have 2 buttons. If you select one button which disables the other one, how do you want to enable it back? And how can it be ToggleButton? You can not click disabled buttons so how does it have to work as ToggleButton? :O You would have to enable the other one back (by clicking some other third button, or the same first button again) before clicking it and disabling the first one. Have you tried using check boxes or radio buttons? You can also use one button as some kind of ToggleButton by checking some conditions in the click button method

      B 1 Reply Last reply
      0
      • N Newbie00

        I don't see any logic here. You want to have 2 buttons. If you select one button which disables the other one, how do you want to enable it back? And how can it be ToggleButton? You can not click disabled buttons so how does it have to work as ToggleButton? :O You would have to enable the other one back (by clicking some other third button, or the same first button again) before clicking it and disabling the first one. Have you tried using check boxes or radio buttons? You can also use one button as some kind of ToggleButton by checking some conditions in the click button method

        B Offline
        B Offline
        Bulky Fellow
        wrote on last edited by
        #3

        Newbie00 wrote:

        I don't see any logic here. You want to have 2 buttons. If you select one button which disables the other one, how do you want to enable it back? And how can it be ToggleButton? You can not click disabled buttons so how does it have to work as ToggleButton? :O You would have to enable the other one back (by clicking some other third button, or the same first button again) before clicking it and disabling the first one. Have you tried using check boxes or radio buttons? You can also use one button as some kind of ToggleButton by checking some conditions in the click button method

        I guess you can follow the conventional toggling method with a single button and a related flag variable. click it, flag becomes 1, click it again, flag becomes 0, and act accordingly. Change some text and appearance for the two states. That's as simple as it can get. Oh, you have to take care of the initial state also. You know, the default value thing. :->

        ASP - AJAX is SEXY. PERIOD.

        N 1 Reply Last reply
        0
        • B Bulky Fellow

          Newbie00 wrote:

          I don't see any logic here. You want to have 2 buttons. If you select one button which disables the other one, how do you want to enable it back? And how can it be ToggleButton? You can not click disabled buttons so how does it have to work as ToggleButton? :O You would have to enable the other one back (by clicking some other third button, or the same first button again) before clicking it and disabling the first one. Have you tried using check boxes or radio buttons? You can also use one button as some kind of ToggleButton by checking some conditions in the click button method

          I guess you can follow the conventional toggling method with a single button and a related flag variable. click it, flag becomes 1, click it again, flag becomes 0, and act accordingly. Change some text and appearance for the two states. That's as simple as it can get. Oh, you have to take care of the initial state also. You know, the default value thing. :->

          ASP - AJAX is SEXY. PERIOD.

          N Offline
          N Offline
          Newbie00
          wrote on last edited by
          #4

          Exactly, that's what I meaned writing about one button which could be ToggleButton. The idea with 2 buttons working as ToggleButton wasn't very good.

          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