Solved

advanced datagrid, drop down list, listbox

Posted on 2003-10-26
3
254 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 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saveas need to save a copy 16 26
Visual Studio - "Windows Form Designer generated code" 2 40
Host asp.net pages 5 26
Run time Error 4 35
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now