Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

Autocomplete of combo box

I have programmed with MS Access/VBA for a number of years and have decided to re-write a marketed application in VB.net.

What a learning curve.

Several of you have helped me immensely with a number of problems.  Almost all of which (issues) I am 100% satisfied.

I've reviewed several versions of 'autocomplete' class code examples.  None of which were truly functional or have the
'professional look and action' as the one that is inherent to MS Access.  Why wouldn't the Microsoft designers of VB take
a lesson or two from the Microsoft designers of MS Access when it comes to such a rudimentary property of a combo box?

Having said that, there is one entry on the forum here dealing with some code I am having problems with but want to test with
the hopes that it will have the look I'm hoping for.

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21689292.html?qid=21689292
or
TheLearnedOne {http:#15660554}

The following link at the beginning of his post:

' Source:
'   http://63.236.73.220/showthread.php?t=277805

does not explicitly show how to modify for combo box.  It refers to use with a list box.  I'm assuming the code in his posting below
the 'Source:' link is specific to using a combo box.

Because of my beginner status and lack of experience with classes and commands, I don't quite understand the complete setup of
this AutoCompleteComboBox class.  At the end of TheLearnedOne's Accepted Answer he makes reference to how to set up.....but
not in an explicit way that I unfortunately need because of my lack of experience.  I do have valid code designed to a point.  But I
don't understand the integration with getting the combo box on the form.

        Private acStatus As AutoCompleteComboBox
        acStatus.Enabled = True
        acStatus.LoadWords(dsStatus, "tbl_correspondence_status", 1)
        acStatus.InitializeAutoCompletion()

The existing combo box I have on the form at this point is set up like this and is unbound:

        With cmboStatus
            .DataSource = dtStatus
            .ValueMember = "field_order"
            .DisplayMember = "field_description"
        End With


Am I suppose to be able to drag and drop a new AutoCompleteComboBox from the toolbox?
Do I have to do everything programmatically?
I have existing combo boxes using datatables.  Do I somehow integrate them with this class?

Please help!

Thanks.

Phil
0
TSFLLC
Asked:
TSFLLC
1 Solution
 
Bob LearnedCommented:
1) Create a class in your project
2) Copy/paste the code from that question over the top of all the code in that class
3) Build the solution
4) Right-click on the toolbox
5) Select 'Add/Remove item'
6) Browse to the location for the project DLL (bin folder)
7) Add the control to the toolbox
8) Drag/drop the control on a form

Bob
0
 
TSFLLCAuthor Commented:
Bob,

Followed the directions to the T and it works well.

So far, this seems to be the best layout.

Thanks for the assistance.


Phil
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now