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. WPF
  4. Custom drawing ToggleButton when checked

Custom drawing ToggleButton when checked

Scheduled Pinned Locked Moved WPF
comgraphicsdevopstutorial
3 Posts 2 Posters 9 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
    Maximilien
    wrote on last edited by
    #1

    Hi. I have a request to change the look of our TogggleButton. I'm not sure what to search for on the internet. Instead of changing the background color when the TogggleButton is checked, I would need to have a line under it. See imgur image : [togglebutton - Album on Imgur](https://imgur.com/a/QGrR9BW) I know how to use ControlTemplates (with Storyboard and Coloranimation with the EnterActions and ExitActions) to change the background. But I'm not sure how to do this for BorderThickness or if there is something better I could use. Thanks for hints or tips or any "google search" I can do

    CI/CD = Continuous Impediment/Continuous Despair

    L 1 Reply Last reply
    0
    • M Maximilien

      Hi. I have a request to change the look of our TogggleButton. I'm not sure what to search for on the internet. Instead of changing the background color when the TogggleButton is checked, I would need to have a line under it. See imgur image : [togglebutton - Album on Imgur](https://imgur.com/a/QGrR9BW) I know how to use ControlTemplates (with Storyboard and Coloranimation with the EnterActions and ExitActions) to change the background. But I'm not sure how to do this for BorderThickness or if there is something better I could use. Thanks for hints or tips or any "google search" I can do

      CI/CD = Continuous Impediment/Continuous Despair

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Use a one sided border:

      Toggle the visibility of the border, the Brush (Transparent), or change the thickness - based on "Checked".

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      M 1 Reply Last reply
      0
      • L Lost User

        Use a one sided border:

        Toggle the visibility of the border, the Brush (Transparent), or change the thickness - based on "Checked".

        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

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

        Just found out we already have an in-house style for that in one of our dependency. :-D Thanks.

        CI/CD = Continuous Impediment/Continuous Despair

        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