• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

Blue outline around disabled widgets is inconsistent

Hi!

When you disable a textbox on a Windows form, the background goes to gray and the outline remains blue. For other widgets such as ComboBoxes and CheckBoxes though, the outline disappears. This makes a form look a little "unkempt". Does anyone know how to either dump the blue outline in a TextBox, or enable the blue outline for other widgets? We can go either way, it just needs to be consistent. Thanks!
0
TravisMS
Asked:
TravisMS
  • 3
1 Solution
 
bpmurrayCommented:
If there's a blue border around the input box, you can remove it using styles. You can do it per component:
   <input type="text" style="border-width:0;" ...

Alternatively, you can set it in the styles section, where it'll change ALL input elements, not just text:
<style type="text/css">
      input {
            border-width:0;
            border-width:0;
      }
</style>
0
 
bpmurrayCommented:
Actually, it should be restricted to disabled input elements:
<style type="text/css">
     input:disabled {
          border-width:0;
     }
</style>
0
 
TravisMSAuthor Commented:
This is a Windows form project though, not an ASP form. Is there anyway to do this in a Windows app?

Thanks!
0
 
bpmurrayCommented:
As far as I know, this has to be done atthe individual control level. I know you can set the margins - I think the default is 3 - but if you set the control's BackColor, you can adjust the style. I don't know if that will resolve the issue, but I've never run into this before.

Hope this helps a little.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now