Private Sub Text1_Change()
在屏南等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場(chǎng)前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供網(wǎng)站設(shè)計(jì)、成都網(wǎng)站制作 網(wǎng)站設(shè)計(jì)制作按需網(wǎng)站開發(fā),公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站制作,成都全網(wǎng)營(yíng)銷,外貿(mào)網(wǎng)站制作,屏南網(wǎng)站建設(shè)費(fèi)用合理。
For x = 0 To List1.ListCount - 1
If Text1.Text = List1.List(x) Then
List1.Selected(x) = True
End If
Next x
End Sub
假如Form1有個(gè)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
有甚多辦法,我說個(gè)最簡(jiǎn)單的
dim xstr as string = "abcde"
Xstr = "(" xstr ")"
dim Userlist() as string
redim Userlist(10)
for i=0 to 10
userlist(i) = i
Next
這樣就行
Public?Sub?AutoComplete(ByVal?cmb?As?ComboBox,?ByVal?e?As?System.Windows.Forms.KeyPressEventArgs)
If?cmb.DataSource?Is?Nothing?Then
Return
End?If
If?e.KeyChar?=?Microsoft.VisualBasic.ChrW(Keys.Enter)?Then
Return
End?If
Dim?strFindStr?As?String?=?""
If?e.KeyChar?=?Microsoft.VisualBasic.ChrW(Keys.Back)?Then
If?(cmb.SelectionStart?=?cmb.Text.Length)?Then
If?cmb.Text.Length??0?Then
strFindStr?=?cmb.Text.Substring(0,?cmb.Text.Length?-?1)
End?If
Else
If?cmb.SelectionStart??0?Then
strFindStr?=?cmb.Text.Substring(0,?cmb.SelectionStart?-?1)
End?If
End?If
e.Handled?=?False
Else
If?(cmb.SelectionLength?=?0)?Then
strFindStr?=?cmb.Text?+?e.KeyChar
Else
If?(cmb.SelectionStart?=?cmb.Text.Length)?Then
strFindStr?=?e.KeyChar
Else
If?cmb.SelectionStart??0?Then
strFindStr?=?cmb.Text.Substring(0,?cmb.SelectionStart?-?1)?+?e.KeyChar
Else
strFindStr?=?e.KeyChar
End?If
End?If
End?If
End?If
Dim?intIdx?As?Integer?=?-1
Dim?dv?As?DataView
If?TypeOf?(cmb.DataSource)?Is?DataTable?Then
dv?=?CType(cmb.DataSource,?DataTable).DefaultView
If?strFindStr??""?Then
dv.RowFilter?=?cmb.DisplayMember??"?Like?'%"??strFindStr??"%'"
Else
dv.RowFilter?=?""
End?If
cmb.DataSource?=?dv
cmb.SelectedIndex?=?-1
cmb.Text?=?strFindStr
Else
dv?=?CType(cmb.DataSource,?DataView)
If?strFindStr??""?Then
dv.RowFilter?=?cmb.DisplayMember??"?Like?'%"??strFindStr??"%'"
Else
dv.RowFilter?=?""
End?If
cmb.DataSource?=?dv
cmb.SelectedIndex?=?-1
cmb.Text?=?strFindStr
End?If
cmb.SelectionStart?=?strFindStr.Length
e.Handled?=?True
End?Sub
Private?Sub?comboBox1_KeyPress(ByVal?sender?As?System.Object,?ByVal?e?As?System.Windows.Forms.KeyPressEventArgs)?Handles?comboBox1.KeyPress
AutoComplete(sender,?e)
End?Sub
網(wǎng)站題目:包含vb.net填充字符的詞條
當(dāng)前路徑:http://jinyejixie.com/article42/dodhchc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供服務(wù)器托管、軟件開發(fā)、面包屑導(dǎo)航、企業(yè)建站、建站公司、品牌網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)