Textarea cursor shining through Listbox


I have a little but annoying problem:
I wrote an editor, which allows the user to type ancient greek text easily. When you click a certain button in the menu, a Listbox is rolling in from the right side showing recent documents to choose from. The Listbox is overlapping the Textarea in this case.

The problem is, that the blinking cursor of the Textarea is shining through and you can see it in the Listbox (see image), although the order of controls clearly sets the Listbox in front of the Textarea. I tried several things in order to prevent that behavior, but none of them were successful. I tried setting the Textarea to readonly when the Listbox is visible, but the cursor still appears. Setting the Textarea to disabled removes the cursor, but then in Windows the Textarea is greyed out, which I do not want either. Toying with the system cursors only seems to apply to mouse cursors and does not have the desired effect.

Does anybody know, how the cursor can be made invisible or removed, while another control is overlapping the Textarea? Of course I could just position the Listbox next to the Textarea, but that would go against the whole design idea of the application.

Best regards and thanks in advance!

Try putting the list box on a container control and move the whole CC in and out.

set the text area to read only

Sorry for the late reply, but there have been some busy weeks…

Unfortunately none of the suggestions worked the way I wanted it, but in the meantime I redesigned the application so that the posted problem is not an issue any more.
There is another problem now, but I will open a different thread for that.

Set focus on another control, then set it back when you remove the listbox.

Just make the TextArea.visible = False when the Listbox is over it.