Click here to Skip to main content
16,012,843 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i want to write a word in richtextbox and then i want to change it size with mouse and move it all around the page how can i do it?
if its not possible please tell me its possible with what control
With Respect
Posted
Comments
BillWoodruff 16-Feb-15 18:32pm    
Is this Windows Forms ?

1 solution

Yeah the RichTextBox doesn't really support something like that. You can change the side if you handle the mouse wheel events, but moving the text around isn't supported.

You can do something like that with a Label on a Panel control, but you have to come up with the code to move the label around under the mouse.
 
Share this answer
 
Comments
BillWoodruff 16-Feb-15 19:58pm    
"Yeah the RichTextBox doesn't really support something like that."

For Win Forms, I respectfully disagree with the caveat that getting exactly the interface/mouse functionality the OP describes is not trivial. In WinForms the RichTextBox has had the 'EnableAutoDragDrop property since FrameWork 2.0.
Dave Kreskowiak 16-Feb-15 20:25pm    
I don't think the traditional drag & drop functionality is what he was talking about. I think he was trying to grab a block of text and drag it around the page like you do in PowerPoint.

The EnableAutoDragDrop property doesn't do that.
BillWoodruff 17-Feb-15 3:51am    
I am puzzled by your remark since I know I can select an arbitrary contiguous block of text in a RichTextBox and relocate it by drag-drop it anywhere in the RichTextBox if that flag is set to 'true. Further, I could add my own EventHandlers for ItemDrag, etc. and implement that on my own with a different dynamic preview while dragging ... if I were willing to do the work.

While the WinForms RichTextBox does not expose the DragDrop related Properties, Methods, and Events at design-time in the Property Browser: in your code you can use all of them.
Dave Kreskowiak 17-Feb-15 12:52pm    
Hmmm....I haven't tried it - just read the documentation on the drag and drops stuff on the RichTextBox. I'm assuming it works just like every other drag and drop support in every other control.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900