Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

advanced datagrid, drop down list, listbox

Posted on 2003-10-26
3
Medium Priority
?
296 Views
Last Modified: 2006-11-17
hi
I am looking after the following "FREE" controls:
A datagrid list box which allows people to drag and drop rows so that they are sorted. Up and Down buttons are required too.
A dropdown list which does text auto complete like internet explorer does with the address field.

Thank you.
F
0
Comment
Question by:fouadkassab
  • 2
3 Comments
 
LVL 3

Expert Comment

by:the-edge
ID: 9625988
for the dropdown list which does text auto complete like internet explorer does with the address field take a look at this:

http://www.vbcity.com/forums/faq.asp?fid=38&cat=ListBox%2FComboBox
0
 

Author Comment

by:fouadkassab
ID: 9630137
the function does not work. anyway, the signature of the key up function is not identical to the one in the example.
0
 
LVL 3

Accepted Solution

by:
the-edge earned 1500 total points
ID: 9630554
here's a sub in vb.net that autocomplete a combobox. you should call it within the KeyUp event of the combobox, passing the combobox and the e.KeyCode as parameter:

    Private Sub myCombo(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cbxUtente.KeyUp
        cbxAutocomplete(myCombo,e.Keycode)
    End Sub


    Sub cbxAutocomplete(ByVal myCombobox As ComboBox, ByVal myKey As Keys)
        Dim index As Integer
        Dim actual As String
        Dim found As String

        'Do nothing for certain keys such as the arrows and backspace and delete
        If myKey = Keys.Back Or myKey = Keys.Left Or myKey = Keys.Right Or (myKey = Keys.Up) Or (myKey = Keys.Delete) Or (myKey = Keys.Down) Then
            Exit Sub
        End If
        ' Store the actual text that has been typed
        actual = myCombobox.Text

        ' Find the first match for the typed value
        index = myCombobox.FindString(actual)

        'Get the text of the first match
        If index > -1 Then
            found = myCombobox.Items(index).ToString()
            'this.comboBox1.Text = found;
            myCombobox.SelectedIndex = index
            ' Select the automatically added text so further typing will replace it
            myCombobox.SelectionStart = actual.Length
            myCombobox.SelectionLength = found.Length
        End If
    End Sub
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question