a="@1991@1205@844@3276@1104@747@1069@0.9@4@3@104810571073
我们提供的服务有:网站建设、做网站、微信公众号开发、网站优化、网站认证、衡山ssl等。为千余家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的衡山网站制作公司
"
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
到底是加左边还是加右边啊?
加左边的话可以用Format(number, "000000"),得到的数如果不足6位则自动在左边补0。
加右边的话,可以用
While Len(st)6
st=st+"0"
Wend
得到的st就保证6位
当前题目:vb点虐
字符串补位 vb 字符串
文章链接:https://www.cdcxhl.com/article28/ddjijcp.html
成都网站建设公司_创新互联,为您提供网站制作、网站排名、网站建设、Google、电子商务、手机网站建设
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联