0

I'm creating an application to help with e-mail replying, so I got a few sample mensages I want to Paste into the e-mail text page, starting from the cursor position.

Imagine, I got this app with Button1,2,3,4 etc, and associated to each button is a pre-formated text, so when I hit Button1 it will Paste the text, starting the cursor location.

Is it possible? And what's the code to do it?

Thanks!

4

2 回答 2

1

You can use a Rich Textbox for the control. If the pre-formatted text is in your clipboard it should just be a matter of pasting in the rich textbox. Rich Textbox's will hold formatted for RTF. I'm assuming your using C# or VB.NET.

于 2009-06-21T13:53:04.707 回答
0

我正在使用 Visual Studio 2008 Pro,主要使用 VB 语言。在 MSDN 中进行了长时间的研究后,我检查了一些使用剪贴板操作的例程,但我不知道如何正确使用它们。

首先,假设我想在带有换行符的剪贴板格式文本中“插入”......我只设法插入了一个字符串,没有任何换行格式。我真的不需要使用 RTF,Unicode 很适合我,但是......带有换行符。

在那之后是最困难的工作......如何将剪贴板副本自动写入记事本/Word/任何文本光标。我知道这要求太多,但如果我可以将格式化的文本自动“插入”到剪贴板中,然后自己制作粘贴,我会很高兴。

非常感谢您的帮助!

于 2009-06-23T13:08:11.107 回答