WEB开发网
开发学院WEB开发综合 Combo的自动查询技术 阅读

Combo的自动查询技术

 2006-02-27 11:43:31 来源:WEB开发网   
核心提示:DeclareFunctionSendMessageLib"user32"Alias"SendMessageA"(ByValhwndAsLong,ByValwMsgAsLong,ByValwParamAsLong,lParamAsAny)AsLongPublicConstCB_F
DeclareFunctionSendMessageLib"user32"Alias"SendMessageA"(ByVal
hwndAsLong,ByValwMsgAsLong,ByValwParamAsLong,lParamAsAny)
AsLong
PublicConstCB_FINDSTRING=&H14C
PRivateSubCombo1_Change()
DimiStartAsInteger
DimsStringAsString
StaticiLeftOffAsInteger
iStart=1
iStart=Combo1.SelStart
IfiLeftOff<>0Then
Combo1.SelStart=iLeftOff
iStart=iLeftOff
EndIf
sString=CStr(Left(Combo1.Text,iStart))
Combo1.ListIndex=SendMessage(Combo1.hwnd,B_FINDSTRING,-1,ByValCStr(
Left(ombo1.Text,iStart)))

IfCombo1.ListIndex=-1Then
iLeftOff=Len(sString)
combo1.Text=sString
EndIf
Combo1.SelStart=iStart
iLeftOff=0
EndSub
静态变量iLeftOff指定了字符长度。->

Tags:Combo 自动 查询

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接