Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di ghini76
    Registrato dal
    Jun 2003
    Messaggi
    560

    [VB6] Intellisense sulle combo!!

    Vorrei dare l'effetto di autoriempimento su una combobox...
    tipo la casella "indirizzo" di Internet Explorer avete presente?
    Qualcuno sa come si fa?

    Grazie

  2. #2
    Utente di HTML.it L'avatar di yyzyyz
    Registrato dal
    Oct 2001
    Messaggi
    1,653
    prova questo:
    codice:
    Private Sub Form_Load()
    oComboBox.AddItem "marcello"
    oComboBox.AddItem "franco"
    oComboBox.AddItem "giuseppe"
    oComboBox.AddItem "ghini76"
    End Sub
    Public Sub ComboBoxAutoCompleteTyping(oComboBox As ComboBox)
        Dim SelStart As Integer
        Dim t As Integer
        
        SelStart = oComboBox.SelStart
        t = 0
        While Left(UCase(oComboBox.List(t)), oComboBox.SelStart) _
                <> UCase(oComboBox.Text) And t < oComboBox.ListCount
            t = t + 1
        Wend
        If t < oComboBox.ListCount Then
            oComboBox.Text = oComboBox.List(t)
            oComboBox.SelStart = SelStart
            oComboBox.SelLength = Len(oComboBox.List(t)) - SelStart
        End If
    End Sub
    
    Private Sub oComboBox_Change()
    Call ComboBoxAutoCompleteTyping(oComboBox)
    End Sub
    
    Private Sub oComboBox_Click()
    MsgBox (oComboBox.Text)
    End Sub
    
    Private Sub oComboBox_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        oComboBox_Click
    End If
    End Sub

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.