Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Autocomplete VB.NET

Autocomplete VB.NET

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpcsharpdatabasetools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    Xequence
    wrote on last edited by
    #1

    I am running a process card that has multi-users. Functionality would be to have an autocomplete box in the "dropdownlist" utility. Despite my attempts I am unable to have a keychange event used in the box. This is the code I use for a combo box to autocomplete, but as my problem is in a dropdownlist, it does not allow me to use a keypress event. Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress If Char.IsControl(e.KeyChar) Then Return With Me.ComboBox1 Dim ToFind As String = .Text.Substring(0, .SelectionStart) & e.KeyChar Dim Index As Integer = .FindStringExact(ToFind) If Index = -1 Then Index = .FindString(ToFind) If Index = -1 Then Return .SelectedIndex = Index .SelectionStart = ToFind.Length .SelectionLength = .Text.Length - .SelectionStart e.Handled = True End With End Sub Please help with any method used to create a keypress event creator. Regards, Nicholas

    P 1 Reply Last reply
    0
    • X Xequence

      I am running a process card that has multi-users. Functionality would be to have an autocomplete box in the "dropdownlist" utility. Despite my attempts I am unable to have a keychange event used in the box. This is the code I use for a combo box to autocomplete, but as my problem is in a dropdownlist, it does not allow me to use a keypress event. Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress If Char.IsControl(e.KeyChar) Then Return With Me.ComboBox1 Dim ToFind As String = .Text.Substring(0, .SelectionStart) & e.KeyChar Dim Index As Integer = .FindStringExact(ToFind) If Index = -1 Then Index = .FindString(ToFind) If Index = -1 Then Return .SelectedIndex = Index .SelectionStart = ToFind.Length .SelectionLength = .Text.Length - .SelectionStart e.Handled = True End With End Sub Please help with any method used to create a keypress event creator. Regards, Nicholas

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Look around on this site, if you haven't already. There are several articles about AutoComplete functionality...


      If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups