dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: how to create an editable combobox ?

  1. #1
    Join Date
    Oct 2009
    Location
    India
    Posts
    9

    how to create an editable combobox ?

    how to create an editable combobox that remembers up to 10 previous entries (Like the address bar in Internet Explorer).

    Any help would be appreciated ...

  2. #2
    Join Date
    Jul 2009
    Location
    Kuwait
    Posts
    170

    Re: how to create an editable combobox ?

    One way is to
    Copy the values in the combobox to array variable.

  3. #3
    Join Date
    Oct 2009
    Location
    India
    Posts
    9

    Re: how to create an editable combobox ?

    could you provide example of code?

    Thanks for ur reply.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: how to create an editable combobox ?

    Every DB is different, so every PROGRAM is different. It's easy to change field names to match the DB, or make a DATABASE (DB) that matches the program (although it's harder)

    Best bet is to search for something that is *close* to what you want, and then try to fix it. We can help!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Oct 2009
    Location
    India
    Posts
    9

    Re: how to create an editable combobox ?

    Thanks for ur reply.

    i don't want use db for that.

    need to to store in array,flatfiles or xml files,but i dont know how to do that

    i'm very new to vb.net.

    already searched for this didn't find any good article or example.

    Pls provide any example ?

  6. #6
    Join Date
    Jul 2009
    Location
    Kuwait
    Posts
    170

    Re: how to create an editable combobox ?

    I will give a pesudo code , Modify it accordin to your requiremnt

    Code:
    
    
    Dim newarray(5) As String
    dim entrydone as boolean
    
    dim textentry as string
    textentry = combobox.text
    
    for (i =0 to 4)
       if newarray(i) = null
                    newarray(i)=textentry
                   entrydone =true
                 exit for
       endif
    next 
    
    if entrydone=false
      for( i=0 to 3)
           newarray(i)=newarray(i-1)
      next
      newarray(4)=textentry
    endif

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)