假如Form1有个TextBox1,双击TextBox1填入123
创新互联建站主打移动网站、成都网站设计、成都网站制作、网站改版、网络推广、网站维护、域名注册、等互联网信息服务,为各行业提供服务。在技术实力的保障下,我们为客户承诺稳定,放心的服务,根据网站的内容与功能再决定采用什么样的设计。最后,要实现符合网站需求的内容、功能与设计,我们还会规划稳定安全的技术方案做保障。
Public Class Form1
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.DoubleClick
System.Windows.Forms.SendKeys.Send("123")
End Sub
End Class
看你的VB.NET 版本了
用 My.Computer.Keyboard.SendKeys("123", True) 代替 System.Windows.Forms.SendKeys.Send("123") 也可以
原码:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.DoubleClick
My.Computer.Keyboard.SendKeys("123", True)
End Sub
End Class
"insert into point_info values(' " " ' point_count ' , " " ' p1.label1.Text ' , " " 28,18,70,30 ")"
有甚多办法,我说个最简单的
dim xstr as string = "abcde"
Xstr = "(" xstr ")"
'首先用webclient获得贴吧首页的源码。这里以vb,net贴吧为例
Private Sub BtnGetNum_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGetNum.Click
Dim url As String = ""'vb.net吧的首页
Dim MyClient As System.Net.WebClient = New System.Net.WebClient
Dim MyReader As New System.IO.StreamReader(MyClient.OpenRead(url), System.Text.Encoding.Default) '定义新的文件流并读取网页文件数据
Dim longTxt As String = MyReader.ReadToEnd '写入
'分析源码,获取主题数
Dim startStr As String = "共有主题数"
Dim startNum As Long = InStr(longTxt, startStr) + Len(startStr) + 18
Dim resStr As String = ""
Do Until Mid(longTxt, startNum, 1) = “"
resStr = resStr Mid(longTxt, startNum, 1)
startNum = startNum + 1
Loop
Label1.Text = resStr '显示主题数
End Sub