Dragging image inside the RichTextBox ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If I have an image inside the RichTextBox, can I drag/move it inside the RichTextBox with the help of mouse, just like we can move any control on the form during design time.
Please guide
 
Hi sachin
One thing you can do it to catch the mouseDown event of that image .
Inside that event handler , get the indices of the mouse and move the image
accordingly ( by changing the value of its location property at runtime )..
hope that helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Thanks for the reply.
Well, I will be inserting the image at runtime in Rich Text Box, in that case writing an event at design time won't be possible. First I will have to check in the click event of Rich Text Box that I've clicked on the image and then I will have to move it, but don't know how to do that :-(
 
Hi sachin
'Well, I will be inserting the image at runtime in Rich Text Box, in that
case writing an event at design time won't be possible". Will, what I
understand from that is that you will be adding the image as object at
runtime ?? is it is so, you can write the event handling method beforehand
. and once you create the image object subscribe that handling method to
the drag event of your newly added image .
Hope that helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top