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. focus rectangle [modified]

focus rectangle [modified]

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelpquestion
6 Posts 2 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.
  • B Offline
    B Offline
    bahaa_sa5
    wrote on last edited by
    #1

    hi all, I'm using VS.net2005 C#, I've class inherited from System.Windows.Forms.Button named PanelButton and FlatStyle is Flat, in run time when the PanelButton foucsed there is a rectangle displayed in the middle of button, i want to hide this rectangle..is it possible? plz i need any one have an idea to help me. thank you -- modified at 5:11 Sunday 27th August, 2006

    N 1 Reply Last reply
    0
    • B bahaa_sa5

      hi all, I'm using VS.net2005 C#, I've class inherited from System.Windows.Forms.Button named PanelButton and FlatStyle is Flat, in run time when the PanelButton foucsed there is a rectangle displayed in the middle of button, i want to hide this rectangle..is it possible? plz i need any one have an idea to help me. thank you -- modified at 5:11 Sunday 27th August, 2006

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      Hello Yes of course in many ways.. The simplest one is to handle the paint event, and draw another rectangle over this one using the BackColor of your button. This should hide it. Regards:rose:

      B 1 Reply Last reply
      0
      • N Nader Elshehabi

        Hello Yes of course in many ways.. The simplest one is to handle the paint event, and draw another rectangle over this one using the BackColor of your button. This should hide it. Regards:rose:

        B Offline
        B Offline
        bahaa_sa5
        wrote on last edited by
        #3

        hello, this may help if the button have a back color, but what can i do if the back color of the button is transparent? thank you

        N 1 Reply Last reply
        0
        • B bahaa_sa5

          hello, this may help if the button have a back color, but what can i do if the back color of the button is transparent? thank you

          N Offline
          N Offline
          Nader Elshehabi
          wrote on last edited by
          #4

          Hello This rectangle appears around the text in the middle of the button. So, take the value of the string when it changes, put it in a private field. Now, make the Text = "", and draw the text yourself from te string your've stored in the paint event.

          Regards:rose:

          B 1 Reply Last reply
          0
          • N Nader Elshehabi

            Hello This rectangle appears around the text in the middle of the button. So, take the value of the string when it changes, put it in a private field. Now, make the Text = "", and draw the text yourself from te string your've stored in the paint event.

            Regards:rose:

            B Offline
            B Offline
            bahaa_sa5
            wrote on last edited by
            #5

            i'm fear to disturb you, my button already has no text in spite of that "This rectangle appears around the text space in the middle of the button." as u said thanks for reply

            N 1 Reply Last reply
            0
            • B bahaa_sa5

              i'm fear to disturb you, my button already has no text in spite of that "This rectangle appears around the text space in the middle of the button." as u said thanks for reply

              N Offline
              N Offline
              Nader Elshehabi
              wrote on last edited by
              #6

              Hello No text!!:wtf: You are not making this any easy, are you? Alright! I'm out! I don't know!! What is this rectangle?? If there is no text in the button it shouldn't appear!! Something is wrong in this matter. I want to help, but, the last thing I got in my sleeves is a bit inconvenient. Don't give your button a focus. IIRC it would be

              SetStyle(ControlStyles.Selectable, false);//or something

              This way it won't get input focus, and you still can click it by the mouse -but not the keyboard- I hope this works, otherwise I'm moving to java!;P

              Regards:rose:

              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