FindStringInListBoxOrComboBox = True End If End If End Function '在ListBox或ComboBox中搜索指定字符串,并按照是否完全匹配,返回找到字符串所在的索引值。未找到返回 -1 Public Function GetStringIndexInListBoxOrComboBox(ByVal ctlControlSearch As Control, ByVal strSearchString As String, Optional ByVal...
Private Const CB_ERR = -1'在ListBox或ComboBox中搜索指定字符串,并按照是否完全匹配,返回布尔值。 Public Function FindStringInListBoxOrComboBox(ByVal ctlControlSearch As Control, ByVal strSearchString As String, Optional ByVal blFindExactMatch As Boolean = True) As Boolean On Error Resume Next Di...
B_FINDSTRING, -1, ByVal CStr(Left( _ ombo1.Text, iStart))) If Combo1.ListIndex = -1 Then iLeftOff = Len(sString) combo1.Text = sString End If Combo1.SelStart = iStart iLeftOff = 0 End Sub 静态变量iLeftOff指定了字符长度。 自动选择Text的内容 在使用VFP的应用进行录入时,每进入...
Public Const CB_FINDSTRING = &H14C Private Sub Combo1_Change() Dim iStart As Integer Dim sString As String Static iLeftOff As Integer iStart = 1 iStart = Combo1.SelStart If iLeftOff <> 0 Then Combo1.SelStart = iLeftOff iStart = iLeftOff End If sString = CStr(Left(Combo1.Tex...
Public Const CB_FINDSTRING = &H14C Private Sub Combo1_Change() Dim iStart As Integer Dim sString As String Static iLeftOff As Integer iStart = 1 iStart = Combo1.SelStart If iLeftOff <> 0 Then Combo1.SelStart = iLeftOff iStart = iLeftOff End If sString = CStr(Left(Combo1.Tex...