vb 用left函数怎么写粘贴代码

来源:百度知道 编辑:UC知道 时间:2024/06/07 06:17:38
有两个按钮一个复制一个粘贴 一个文本框 在文本框里输入文字 然后选中点复制 再点粘贴。 写好之后粘贴总是在一个地方。而不在光标的地放粘贴。
要用Left 这个函数写粘贴那个按钮的代码。 有大虾会吗???
Public a As String
Private Sub cmd1_Click()
a = txt1.SelText
End Sub
Private Sub cmd3_Click()
txt1.Text = Left(txt1.Text, Val(txt1.SelStart)) + a

End Sub

很简单的:

放置Text1和Text2,还有Command1和Command2

其中Text1为复制源,Text2为目标

Command1为复制

Command2为粘贴

以下是代码:

Dim s As String

Private Sub Command1_Click()

    s = Text1

End Sub

Private Sub Command2_Click()

    Text2 = Left(Text2, Text2.SelStart) & s & Mid(Text2, Text2.SelStart + Text2.SelLength + 1)

End Sub

然后运行,效果如图

vb中的left怎么用啊 VB函数返回值怎么写? vb中的left$函数问题,急,谢谢啦 vb中的left$提取字符串函数问题,急,谢谢啦 怎么调试这个函数(ASP VB)<% =left("this is a test!",6) %> left是什么意思,怎么用? API函数是怎么用到VB中的,难道像用VB函数那样点下按钮就直接写到里面吗? VB中的log()函数该怎么用? VB的随即抽取函数怎么用 VB中的SPC()函数怎么用?