复制文本并在vb应用程序中显示 [英] Copy text and show in the vb application
问题描述
我正在努力寻找解决方案,如何需要复制文字和这些文字 转到我的应用程序文本框区域。我想解释一下。如果我选择文本,例如在nopated程序中 并复制"ctrl + C"然后这个选择文字显示 到我的
应用程序文本框区域。 图片如下。但我不知道该怎么做。也许有人可以让我在路上,怎么做?应用程序编写语言C#
I am trying to find solution, how need copy text and these text go to my application textBox area. I am trying to explain. If I select text e.g In the nopated program and make copy "ctrl+C" then this select text show to my application textBox area. Picture below. But I don't know how need to do it. Maybe someone can get me on the road, how to do it? The application write languages C#
推荐答案
您好
很难理解你的问题。
这是一些代码 - 这段代码在运行时会显示ClipBoard当前文本。因此,当你从某个地方Ctrl-C(或任何文本副本 - 即上下文菜单Copy等)时,它将显示在此应用程序的TextBox中。
Here is some code - this code, while running, will show the ClipBoard current Text. So, when you Ctrl-C (or any text copy - ie context menu Copy etc) from somewhere, then it will show up in the TextBox of this application.
' Form1 with TextBox1
' and Timer1
Option Strict On
Option Explicit On
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Clipboard.Clear()
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
TextBox1.Text = Clipboard.GetText
End Sub
End Class
这篇关于复制文本并在vb应用程序中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!