Pete
Rookie

How do I copy to clipboard in the visual basic enabling me to use vb rich text?


How do I copy to clipboard in the visual basic enabling me to use vb rich text? Once I from the left hand side of the screen I drag a label from components list into my window, I placed it near the top somewhere on the window. Then I changed the text property from the bottom right hand side of the screen located in the property list editor to enable it to read like the message - this is the text that will be copied to the clipboard. What do now, what is the path from here to copy to clipboard enabling me to use vb rich text?
5 months ago
Respond to this discussion
Naina Mahajan | Dec 18 2011

While you don’t say specifically, my hunch is that you’ve included the

standard shortcuts such as Ctrl-C and Ctrl-V on your Edit menu. Unlike the

standard text box, the RichTextBox automatically supports these shortcuts.

This would explain your observation of double cuts, copies, and pastes—your code is

doing it once, and the control might also be doing it if you use the shortcut.

You also need to account for another difference: the default format used by the

Clipboard’s GetText method is vbCFText. If you want to preserve the formatting (why

else use a RichTextBox?), you must specify that with vbCFRTF:

RichTextBox1.SelRTF = Clipboard.GetText(vbCFRTF).or .It’s easy to code Cut, Copy, and Paste routines for a standard text box. For

example, you simply write “Text1.SelText = Clipboard.GetText( )” for Paste

code. But when I tried this on a RichTextBox, it didn’t work correctly. Paste didn’t paste

anything and Copy copied twice.

© 2012, Instamedia. Some rights reserved. Powered by Instapress and Instacheckin.