|
-
Jan 30th, 2004, 06:53 AM
#1
Thread Starter
Lively Member
combo box in VB .net
I was using Combo box in VB 6 which supports IncrementalSearch But in VB net I does not
please help me how to go about it
!!IncrementalSearch ?
An example of an incremental search is if you are searching for the word "ELASTIC," you can type E-L-A, and so on. As you type, it incrementally searches for the combination of letters you have typed to match the word you are looking for and rest on the closest match
with Regards
sameer Mulgaonkar

-
Jan 30th, 2004, 10:00 AM
#2
here's a quick example i knocked up for you to get you started ...
VB Code:
'/// assuming you have a Combobox called " ComboBox1 " on your Form...
Private searcher As String = String.Empty
Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress
If Not e.KeyChar = Convert.ToChar(Keys.Back) Then
searcher += e.KeyChar.ToString
If Not ComboBox1.FindString(searcher) = -1 Then
With ComboBox1
.SelectedIndex = .FindString(searcher)
.SelectionStart = searcher.Length
.SelectionLength = .Text.Length - searcher.Length
End With
End If
Else
ComboBox1.Text = ""
searcher = ""
End If
End Sub
Private Sub ComboBox1_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.Validated
searcher = ""
End Sub
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jan 31st, 2004, 01:22 PM
#3
Frenzied Member
thanks Dynamic...that code works great.
It's tough being an unhandled exception...
___________
VB.NET 2008
VB.NET 2010
ORACLE 11g
CRYSTAL 11
-
Feb 3rd, 2004, 01:19 AM
#4
Thread Starter
Lively Member
which type of combo box style are u using ?
Dropdown
Dropdownlist
I have done the same in Dropdownlist i works
but my problem is the combo box auto Search also get fire
when i Type W-i-
The cursor frist move to W then moves to i and then rest on to wi
than works but does not look good
I want the inbuild auto search of combo box not to be fired
How to go about it
with Regards
sameer Mulgaonkar

-
Feb 3rd, 2004, 01:40 AM
#5
Thread Starter
Lively Member
which type of combo box style are u using ?
Dropdown
Dropdownlist
I have done the same in Dropdownlist i works
but my problem is the combo box auto Search also get fire
when i Type W-i-
The cursor frist move to W then moves to i and then rest on to wi
than works but does not look good
I want the inbuild auto search of combo box not to be fired
How to go about it
with Regards
sameer Mulgaonkar

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|