Border color of a text field??

Is there any way to set the border color of a text field??

OSes? There’s nothing built in but with declares it’s probably doable.

Or in pure Xojo, set the textfields border off and draw it in the Paint event of whatever it’s on

Sub Paint(g As Graphics, areas() As REALbasic.Rect) g.ForeColor = &cFF0000 g.DrawRect(TextField1.Left-1, TextField1.Top-1, TextField1.Width+2, TextField1.Height+2) End Sub

1 Like

where can i find the declare for window to set the border color e.g. to grey??

Trying to revive this topic…

Has anyone figured a nice way to change the color of the border of a TextArea (or TextField) ?

Is there something in the MBS plugin set? I can’t seem to find it :frowning:
I would expect to find something in NSTextFieldMBS, under the Layer property.

There is something in NSTextField.Layer.BorderColor, according to something I just ran into on StackOverflow.

@Edwin_van_den_Akker How did this work out for you?

First I played with the MBS plugins for a bit. But I decided to make the TextField transparent and placed a line underneath. So, I kind of abandoned the BorderColor idea.

Amateur programmer suggestion, turn border off and put a rectangle underneath. You can now change the rectangle as border and can change color and width.

Thanks Chris - I always try to stay away from controls overlapping one another as Windows is horrible with flicker most times with overlapping controls. Instead of spending time making a textfield I am just changing the color or the label which is giving me a nice clean result.

Thanks all!

How about using the window.paint event to fill a rect underneath the textfield?

I am assume that you’re trying to highlight a field that needs some attention?

2 Likes