Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21243

SelStart At Mouse Position

$
0
0
I have a textbox "txtNum" with the following codes

Private Sub txtNum_GotFocus()
txtNum.Text = Format(txtNum.Text, "General Number")
End Sub

Private Sub txtNum_LostFocus()
txtNum.Text = Format(txtNum.Text, "Standard")
End Sub

Now, when I click the text box, thus it gets focus, it is formatted as expected. However, the cursor is always at the beginning of the text.
How can I set the cursor position to where I click?

Viewing all articles
Browse latest Browse all 21243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>