0% found this document useful (0 votes)
22 views

Pencarian Data Dalam Combo Secara Cepat (Script VB) Jumat, 14 November 2008

This document discusses using Visual Basic script to enable quick searching in a combo box. It describes using events like Change and KeyDown to detect when the user is typing in the combo box. When text is entered or deleted, it loops through the list items to find matches and update the combo box text and selection accordingly. This allows searching through the dropdown options as characters are typed without needing to manually open the dropdown each time.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Pencarian Data Dalam Combo Secara Cepat (Script VB) Jumat, 14 November 2008

This document discusses using Visual Basic script to enable quick searching in a combo box. It describes using events like Change and KeyDown to detect when the user is typing in the combo box. When text is entered or deleted, it loops through the list items to find matches and update the combo box text and selection accordingly. This allows searching through the dropdown options as characters are typed without needing to manually open the dropdown each time.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

http://elib.unikom.ac.id/files/disk1/106/jbptunikompp-gdl-s1-2007-rimaaprian-5281-bab-i.pdf http://elib.unikom.ac.id/files/disk1/445/jbptunikompp-gdl-zulfirnand-22246-9-unikom_z-i.

pdf

Pencarian data dalam combo secara cepat (Script Vb) Jumat, 14 November 2008
'// membutuhkan 1 Combobox 'By: eko cahyono Ym:eko_matrix Private cekKey As Boolean Private Sub Combo1_Change() Static ChangeFlag As Boolean Dim cboText As String Dim lencboText As Integer Dim tmpLen As Integer Dim tmp As Integer If Not ChangeFlag Then cboText = Combo1.Text lencboText = Len(Combo1.Text) If Not cekKey Then For tmp = 0 To Combo1.ListCount - 1 If UCase(Left(Combo1.Text, Combo1.SelStart)) = UCase _ (Combo1.List(tmp)) Then ChangeFlag = True Combo1.Text = Combo1.List(tmp) Combo1.SelStart = Len(Combo1.Text) ChangeFlag = False cekKey = False Exit Sub End If Next tmp If lencboText > 0 Then For tmp = 0 To Combo1.ListCount - 1 If UCase(Left(Combo1.List(tmp), _ lencboText)) = UCase(cboText) Then tmpLen = lencboText ChangeFlag = True Combo1.Text = Combo1.List(tmp) Combo1.SelStart = tmpLen Combo1.SelLength = Len(Combo1.List( _ tmp)) - tmpLen ChangeFlag = False Exit For End If Next tmp End If End If cekKey = False

End If End Sub Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer) If (KeyCode = vbKeyDelete) Or (KeyCode = vbKeyBack) Then cekKey = True End If End Sub

You might also like