Author Topic: InputControl.Highlight not working correctly?  (Read 3338 times)

fred

  • Full Member
  • ***
  • Posts: 131
If I set highlight background to red:
  <element id="Controls.InputControl.Highlight" bg="255,0,0" fg="255,255,255" bdr="0,0,255"/>
when the text in the control is highlighted the backround is BLUE

Is this a bug? a feature?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
I dont think that element is used any more. Where specifically is the text box you are testing?

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3830
  • MB Version: 3.6.8830 P
It works in some places (like the Prefences window) but in other areas (the tag editor) the Windows forms system colours override the selection.
MusicBee and my library - Making bee-utiful music together

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
When you select text in a textbox, there isnt any way for MB to override the windows colours for text selection. You are probably referring to combo boxes which is not a textbox control

fred

  • Full Member
  • ***
  • Posts: 131
My first thoughts were that if you create a control inheriting from TextBox you could change the colour but then I found this on the Microsoft website:

Overriding OnPaint will not allow you to modify the appearance of all controls. Those controls that have all of their painting done by Windows (for example, TextBox) never call their OnPaint method, and thus will never use the custom code.

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
If I set highlight background to red:
  <element id="Controls.InputControl.Highlight" bg="255,0,0" fg="255,255,255" bdr="0,0,255"/>
when the text in the control is highlighted the backround is BLUE
You may need to post some screenshots.
A quick test with my Sample Skin indicates the element working just fine.


fred

  • Full Member
  • ***
  • Posts: 131
Usually when you get this sort of  problem you Google for free replacement and lots of things come but in this case there was very little  -- there were two commercial products from SyncFusion & Telerik but their cost $999 per year seems a tad expensive for such a trivial change. However I did find something on Code Project that could "fix" this
https://www.codeproject.com/Articles/161871/Fast-Colored-TextBox-for-syntax-highlighting-2

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
Didn't work here I'm afraid:
I see.
Reading your original post I assumed you meant that the blue 0,0,255 value you had set as bdr appeared as background colour somewhere.

The element is working fine, but for dropdown menu's, and not for standard text boxes as has been cleared up now.