TextField/TextArea Borders

My first post here, so greetings to everybody and the best health wishes in these complicated times.

I just realised that TextField and TextArea borders can be only enabled/disabled in the IDE, not on the fly. Tested with 2019r3, Mac and Windows using old .border and new .HasBorder syntax.

Is this a bug or it’s due to some OS limitation ?

Regards.

Tested also with 2019R1, 2018R4 and 2017R2 on Mac, same situation.

Nevertheless border can be shown/hidden on demand using NSTextFieldMBS bordered property, so seems not a OS limitation, at least on Mac.

Would be great if this could be sorted at some point.

Regards.

Can you create a feedback report (bug or feature request)?

The LR does not say it is limited to be set in the IDE. It looks terribly much like a bug. unless it is an LR bug.

Do file a feedback report, with a small project demonstrating the issue.

Thanks both for the reply.

Seems that this has been reported and verified … in 2011.

<https://xojo.com/issue/19246>

Norman suggested there a workaround for MacOs, it works

[code]#if TargetMacOS
declare sub setBezeled lib “Cocoa” selector “setBezeled:” (handle as integer, value as boolean)
// Usage : setBezeled(TextField1.Handle, value)
#endif

if TextField1.Border then
TextField1.Border = False
#if TargetMacOS
setBezeled(TextField1.Handle, false)
#endif
else
TextField1.Border = True
#if TargetMacOS
setBezeled(TextField1.Handle, true)
#endif
end if[/code]

Regards.

I tried the declare on Textarea, it does nothing.

one is probably and NSTextField and the other an NSTextView and they respond differently to different selectors

that one may have no applicability to the NSTextView

Yes, only for a TextField.

Shame this can’t be adjusted in Windows…

It should be possible to do declares in Windows.

Since every control in Windows is considered a window by the framework, this should work on a Textarea/textfield:

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowlonga

Perhaps some iteration of this, I use to remove the border of a window:

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (hwnd As Integer, nIndex As Integer, dwNewLong As Integer) As Integer Const GWL_STYLE = -16 dim rien as integer = SetWindowLong(self.handle, GWL_STYLE, &H800000)

may already have that in his bag of tricks :slight_smile: