十年網(wǎng)站開發(fā)經(jīng)驗 + 多家企業(yè)客戶 + 靠譜的建站團隊
量身定制 + 運營維護+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
a="@1991@1205@844@3276@1104@747@1069@0.9@4@3@104810571073
我們提供的服務(wù)有:網(wǎng)站建設(shè)、做網(wǎng)站、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、衡山ssl等。為千余家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的衡山網(wǎng)站制作公司
"
a=Replace(a,"@",",")
a=Replace(a,"",",")
dim b()
b=split(a,",")
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
到底是加左邊還是加右邊?。?/p>
加左邊的話可以用Format(number, "000000"),得到的數(shù)如果不足6位則自動在左邊補0。
加右邊的話,可以用
While Len(st)6
st=st+"0"
Wend
得到的st就保證6位