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. Properties for Button on selection by "TAB", clicked & when app loses focus

Properties for Button on selection by "TAB", clicked & when app loses focus

Scheduled Pinned Locked Moved Windows Forms
architecturehelpquestion
3 Posts 2 Posters 2 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.
  • A Offline
    A Offline
    All Time Programming
    wrote on last edited by
    #1

    Hello, I have 2 Buttons in my form. Both have background image and Flat style is "Flat". 1) On clicking TAB key, when the focus is on button, I see solid color rectangle inner, instead of solid border I want to have dotted border in the button. 2) If the button is on focus & the application loses focus (someother app is active), the button forms a outer border of white color. I want it to remain as it is i.e. dotted line inner rectangle. 3) When the button is clicked, some activity is going on. While this time the button text colro changes to grey. I don't want it to change the text color. I believe this is windows std property, but how do I not change the text color when the button is selected :~. I can't find any properties to set these points. What should I do to achieve the goal. Any help is highly appreciated.

    Thanks & Regards,

    D A 2 Replies Last reply
    0
    • A All Time Programming

      Hello, I have 2 Buttons in my form. Both have background image and Flat style is "Flat". 1) On clicking TAB key, when the focus is on button, I see solid color rectangle inner, instead of solid border I want to have dotted border in the button. 2) If the button is on focus & the application loses focus (someother app is active), the button forms a outer border of white color. I want it to remain as it is i.e. dotted line inner rectangle. 3) When the button is clicked, some activity is going on. While this time the button text colro changes to grey. I don't want it to change the text color. I believe this is windows std property, but how do I not change the text color when the button is selected :~. I can't find any properties to set these points. What should I do to achieve the goal. Any help is highly appreciated.

      Thanks & Regards,

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      1. This is Windows drawing the focus cue on the button. You cannot change this. 2. Again, Windows. Can't change this. 3. The text turns grey only because your code has to change it. This isn't Windows doing this or a property on the control. When you click on Windows Forms Button, no colors of or inside the button change at all, unless your code is specifically written to do this. [EDIT] 3. I haven't tested this, but this could be because of the Windows Desktop Theme your using.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      1 Reply Last reply
      0
      • A All Time Programming

        Hello, I have 2 Buttons in my form. Both have background image and Flat style is "Flat". 1) On clicking TAB key, when the focus is on button, I see solid color rectangle inner, instead of solid border I want to have dotted border in the button. 2) If the button is on focus & the application loses focus (someother app is active), the button forms a outer border of white color. I want it to remain as it is i.e. dotted line inner rectangle. 3) When the button is clicked, some activity is going on. While this time the button text colro changes to grey. I don't want it to change the text color. I believe this is windows std property, but how do I not change the text color when the button is selected :~. I can't find any properties to set these points. What should I do to achieve the goal. Any help is highly appreciated.

        Thanks & Regards,

        A Offline
        A Offline
        All Time Programming
        wrote on last edited by
        #3

        Thanks Dave, I created a custom Button and got rid of all the issues I had and got it the way I wanted it. Thanks alot to all.

        Thanks & Regards,

        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