How do I hide the Insertion Cursor in TextField / TextArea

In a current project, there is a window where the insert cursor is useless; worst it distract me.

Thus the question:
How do I hide the Insertion Cursor in TextField / TextArea (that window have both). Even when the Mouse is not above one Control. If there can be a Control Area where the Insertion Cursor is invisible and let the remainding of the Window area with the MouseCursor (just in case…), there are buttons in this window.

TIA

make the control.enabled property to false ?
set the focus to another control ?

Maybe use the MouseEnter/MouseExit event of the TextArea to set it to True/False…

Not sure if text has to be entered or not…

I use in many cases a DesktopTextArea with Property disabled to use it as a console logging area (o;

Thanks for your answers.

Change the Control Enabled value: I do not think at that. WIll try.

I set the window focus to Nil, the text do not have to be edited (afaik).
I thank at MouseMove, but the Mouse have to be moved !

Other ideas ?

Hide the MouseCursor and Show the Default when the Mouse is above a valid Control (Button for example) ?

Well when the text doesn’t have to be entered or changed then set the Enabled property in the inspector to false.

You can’t copy text from it though when it’s disabled…

Yes, that’s a drawback.

Well then there’s still the MouseEnter/Exit event you can use…

So for the MouseEnter event for DesktopTextArea:

Me.Enabled = True

And for the MouseExit event:

Me.Enabled = False

Not sure if that is of help in your application as I don’t know what it should do (o;

If the user doesn’t need to enter text but does need to copy the text, then you can just set the control to read only = true

Edit: I think that I misunderstood and you want to hide the mouse cursor, not the blinking insertion point.

This is my first thought as well.

No, I don’t think that’s the case, reading @Emile_Schwarz 's OP.

Disabling the Control was the solution. More, it avoid the Control to get the Focus !!!

Thank You Jean-Yves (et al.)

And there are other ways to copy the text (LiveText on macOS for example/OCR).

I agree Readonly = true sounds like what you want. It prevents editing / insertion point, but it allows copying. It doesn’t change the style of the text (ie it looks like a control with text, not a disabled one). Worth a look?

I made a subclass of textedit/textarea that support a control-clic menu where I add a “copy” command to be able to copy the content of a disabled textedit.

1 Like