Mac Border Colors

Border colors for text areas and text fields (and other things) are really light grey and make it harder for an older person to see where to click. There is no setting for border colors of the text area and text fields. Is there any way I can adjust the border colors in the program without having to edit Mac settings? TIA

1 Like

You could use the window paint event and draw your own borders around them.

1 Like

Tried this but it’s horrible. The original borders are there even if I set .hasborder to false. It doesn’t round with some of the fields. It looks very bad. Anyone else have a solution?

I tend to place controls on dialog boxes within a group box. That way the difference between the background and the text box is somewhat easier to see. For example:

Would that perhaps solve your problem, without borders?

You can also have a GroupBox without a label at the top, just leave the caption blank.

2 Likes

Apple use the same technique in System preferences, the Print dialog and the Page setup dialog.

For those who need it, the Mac’s Accessibility settings have a High Contest setting which enhances borders around controls and makes other changes to colors. This would be the appropriate approach, as it applies system-wide and gives your app the same appearance as other apps.

Yeah thats not a good approach at all. I tried it and it’s horrible and makes my program horrible looking. I don’t want black lines around everything. I just want the borders in my program better defined.

Yeah this is what im considering if it can’t be done with just changing the border. It does take up more space and some of our windows are already crowded and won’t have the space to allocate to a group box or a background rectangle.

Another trick, and quite simple to achieve, is to place a Canvas on the window:

  • Locate it at 0, 0
  • Fill the whole window with it.
  • Sent it to the back of the z-order.
  • Turn on lock for top, left, bottom and right, so it grows with the window
  • Make sure that your controls are parented to the Canvas.

If there is only one window that need fixing add a Shared property to the window:

WindowBGColor as ColorGroup 

In the window Opening event. add:

If WindowBGColor = Nil Then
  WindowBGColor = New ColorGroup( &cE7E7E700, &c25252500 )
End If

In the canvas paint event:

g.DrawingColor = WindowBGColor
g.FillRectangle 0, 0, g.Width, g.Height

This provides:

  • A background that allows you to see the controls.
  • Takes 0 space on the window, so is easy to do.
  • Works with Dark and Light mode.

If you need to do it for more than one window move the Shared property and Opening elements to the App object or a Global module.

Using a shared property prevents multiple instances of it from being created each time you have a new instance of the window. Putting it on App also provides a single global instance. Shared properties on App are also much faster to access than standard ones.

Example:

Trying to set the window background colour will fail as it is ignored by later versions of macOS.

1 Like

Window and container have a paint event. In most cases there is no need for a canvas. All my windows have a common background color. In Tahoe this makes a way better contrast.

Tahoe ignores window background colour on sheet windows. Even when set in the IDE it ends up ‘white’. I haven’t tried drawing in the window paint, I must admit.

Yup, Window paint does work. Setting a background colour in the IDE does for standalone windows, but not for Sheet windows, but Window paint does.

Thanks for the help. This is awesome!

As Beatrix pointed out, you can do without the canvas by using the Window paint event. Which is easier.

Really appreciate some thought given to the problem with so many apps using such low contrast coloring. That and tiny thin fonts!!! Pretty sure I would have hated this style at age 25 and now, 60 years later, my eyes have not gotten better!

Hi James,

unfortunately, you are not alone.