469,964 Members | 1,651 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

Selecting and dragging text on a TextBox

Hi,
In a normal Windows.Forms.TextBox control, I want to be able to select a
text (ie highlight, this is by default possible) and than be able to drag
that text through my mouse pointer to another textbox, or any control, than
drop it. How do v do this?

Regards,

...ab
May 8 '07 #1
2 4312
Abubakar,

You will want to check out the section of the MSDN documentation titled
"Performing Drag-and-Drop Operations in Windows Forms", located at:

http://msdn2.microsoft.com/en-us/lib...30(VS.71).aspx

That example is very similar to what you want to do, with a little
tweaking, it should do exactly what you need it to do.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Abubakar" <em**********@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi,
In a normal Windows.Forms.TextBox control, I want to be able to select a
text (ie highlight, this is by default possible) and than be able to drag
that text through my mouse pointer to another textbox, or any control,
than drop it. How do v do this?

Regards,

..ab

May 8 '07 #2
Hi,
I've followed the article and it explains pretty nicely how to do drag n
drop. But there is one thing I'm unable to manage and thats the selecting
and dragging text from TextBox. Its just the selecting from mouse thats a
problem. I highlight from the mouse in a TextBox and thats easy but as soon
as I do a mouse-down on the selected text with tthe purpose of moving it to
the other TextBox, the highlighting is removed and the text cursor starts
blinking exactly in the place where clicked to drag the text out from.
Unable to handle this...

...ab

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:%2****************@TK2MSFTNGP06.phx.gbl...
Abubakar,

You will want to check out the section of the MSDN documentation titled
"Performing Drag-and-Drop Operations in Windows Forms", located at:

http://msdn2.microsoft.com/en-us/lib...30(VS.71).aspx

That example is very similar to what you want to do, with a little
tweaking, it should do exactly what you need it to do.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Abubakar" <em**********@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Hi,
In a normal Windows.Forms.TextBox control, I want to be able to select a
text (ie highlight, this is by default possible) and than be able to drag
that text through my mouse pointer to another textbox, or any control,
than drop it. How do v do this?

Regards,

..ab


May 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by James Slade | last post: by
4 posts views Thread by melanieab | last post: by
5 posts views Thread by marfi95 | last post: by
reply views Thread by andytsummers | last post: by
2 posts views Thread by JJ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.