2
votes

I've got a textbox that doesn't want to behave in a Winforms application. It's used to send messages, so it's cleared after enter is pressed using Clear()

After that, Select() is called. Sometimes, however, there is no caret. It IS focused, as it accepts text, but it won't show the caret until it is left and re-entered.

Any ideas?

I've tried using Focus() instead, tried using txb->Text = L"", and they all do it. I even tried calling ShowCaret after each call to Select() but that didn't do it either.

1
Maybe using ShowCaret as the opposite of the link here would help: stackoverflow.com/questions/44131/…NoChance
You clear the text and then call Select(). You are selecting what?γηράσκω δ' αεί πολλά διδασκόμε
I'm just giving focus to the textbox.Collin Biedenkapp

1 Answers

0
votes

I could not reproduce this behaviour you speak about but if Clear is not working you could do

textBox.Text = String.Empty;