• 您的位置我爱Aspx >> VB.Net >> Auto Complete combo Box(VB.NET Source Use API)
  • Auto Complete combo Box(VB.NET Source Use API)

  • 作者:aspxer  来源:internet  日期:2007-5-20 14:01:44  关键字:.net,com
  • Dim lngSelectedLength As Long

    Dim lngMatchLength As Long

    Dim strCurrentText As String

    Dim strSearchText As string

    Dim sTypedText As String Const CB_LOCKED = &H255

    Try

    With (comboObj)

    If .Text = Nothing Then

    Exit Function

    End If

    Call LockWindow(.Handle)

    If ((InStr(1, .Text, .Tag, vbTextCompare) <> 0 And Len(.Tag) = Len(.Text) - 1) Or (Left(.Text, 1) <> Left(.Tag, 1) And .Tag <> Nothing)) And .Tag <> CStr(CB_LOCKED) Then

    strSearchText = .Text

    lngSelectedLength = Len(strSearchText)

    lngItemNum = .FindString(strSearchText)

    ComboAutoComplete = Not (lngItemNum = -1)

    If ComboAutoComplete Then

    lngMatchLength = Len(.Items.Item(lngItemNum)) - lngSelectedLength .Tag = CB_LOCKED

    sTypedText = strSearchText

    .Text = .Text & Right(.Items.Item(lngItemNum), lngMatchLength)

    我对这篇文章有话说?
  • 广告位招租,广告代号:content_468_15
  • 上一篇:OK.这个是完整的VB.NET的语法解析程序。比较长,不过支持全部的关键字,直接就可以用了。
    下一篇:VB.NET中的类