十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
Clipboard.SetDataObject(TextBox1.Text)
创新互联于2013年成立,是专业互联网技术服务公司,拥有项目网站设计制作、成都网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元茌平做网站,已为上家服务,为茌平各地企业和个人服务,联系电话:18980820575
复制textbox1.text的内容的剪贴板
例如,把文件"E:\新建文件夹\a.txt"复制到剪贴板
CreateObject("Shell.Application").NameSpace("E:\新建文件夹").ParseName("a.txt").InvokeVerb "复制(C)"
窗体新建一个按钮Command1和文本框Text1
Private Sub Command1_Click()
Dim i As Integer, result As String '定义整型变量i,字符串变量result
For i = 1 To Text1.Text Step 1 '循环过程开始将i的最小值和最大值限定为1和Text1的内容,步距为1
result = result InputBox("") '弹出InputBox并且与之前的合并赋给result
Next '循环过程完毕
Clipboard.Clear '清空剪贴板
Clipboard.SetText result '将剪贴板内容设置为result
End Sub
运行程序后在文本框里面输入要弹出的InputBox个数即可。
Dim p1 As New Point(0, 0)
Dim p2 As New Point(My.Computer.Screen.WorkingArea.Width, My.Computer.Screen.WorkingArea.Height) '除工具栏全屏
Dim pic As New Bitmap(p2.X, p2.Y)
Using g As Graphics = Graphics.FromImage(pic)
g.CopyFromScreen(p1, p1, p2)
PictureBox1.Image = pic
End Using
Clipboard.SetImage(PictureBox1.Image)
截图到PictureBox1中显示,然后在把PictureBox1.image放到剪切板中
复制文件夹不用剪贴板,使用系统文件操作对象就好了
CreateObject("scripting.filesystemobject").copyfolder "c:\Program Files", "D:\Program Files"
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Str As String = Clipboard.GetText '获取剪切板数据。
ListView1.View = View.Details
Dim Tit As Boolean = True
Dim Index As Integer = 0 '标题行的列数。
Try
For Each i In Str.Replace(vbLf, "").Split(vbCr)
Dim Str2() As String = i.Split(" ")
If Tit Then '标题行
Tit = False
For Each k In Str2
ListView1.Columns.Add(k)
Next
Index = Str2.Length - 1
Else '非标题行。
Dim lv As New ListViewItem(Str2(0))
For k = 1 To Index
lv.SubItems.Add(Str2(k))
Next
ListView1.Items.Add(lv)
End If
Next
Catch ex As Exception
End Try
End Sub