G
Guest
Hi there,
I'm designing a winforms app in VB.NET 2.0 and have a textbox control and
also some toolbar buttons. I want to have it such that when the user clicks a
toolbar button, some predefined text - such as the date - is inserted into
the textbox at the point where the caret is. (It's assumed that the user will
be typing and then click the toolbar button.) From my research the textbox
control doesn't seem to support any method of querying the position of the
cursor. I've found documentation on pulling in the function "GetCaretPos"
from user32.dll and using that, but those examples seem to return coordinates
of the caret and not a linear position in the text. Is there a good way
anyone can think of to achieve this?
Thanks...
-Ben
I'm designing a winforms app in VB.NET 2.0 and have a textbox control and
also some toolbar buttons. I want to have it such that when the user clicks a
toolbar button, some predefined text - such as the date - is inserted into
the textbox at the point where the caret is. (It's assumed that the user will
be typing and then click the toolbar button.) From my research the textbox
control doesn't seem to support any method of querying the position of the
cursor. I've found documentation on pulling in the function "GetCaretPos"
from user32.dll and using that, but those examples seem to return coordinates
of the caret and not a linear position in the text. Is there a good way
anyone can think of to achieve this?
Thanks...
-Ben