Set focus dans listview à la première colonne
Hello, pour faire suite à ce sujet : https://forum.excel-pratique.com/excel/interaction-dans-une-listview-170799
J'ai un petit problème et mes recherches n'ont rien données. Quand j'ouvre mon listview et que je clique sur ma première ligne (uniquement la première), un focus s'active sur la première colonne pour modifier la valeur (la modification n'est pas prise en compte dans la base de donnée).
Comment désactiver ce focus ?
Si j'ai plusieurs lignes et que je clique sur une autre puis que je reclique sur la 1ere, ça ne le fait plus. Mais c'est chiant pour un utilisateur lambda haha.
Merci ! (code de mon listview :)
Private Sub UserForm_Initialize()
With AffichageDemande
.Gridlines = True 'Affiche les lignes
.View = lvwReport 'Style d'affichage
.FullRowSelect = True 'Selectionner une ligne possible avec colorisation
'Création d'entête personnalisée
.ColumnHeaders.Add Text:="Index", Width:=20
.ColumnHeaders.Add Text:="Etat", Width:=20
.ColumnHeaders.Add Text:="Date", Width:=55
.ColumnHeaders.Add Text:="Nom", Width:=50
.ColumnHeaders.Add Text:="ID", Width:=50
.ColumnHeaders.Add Text:="CA", Width:=50
.ColumnHeaders.Add Text:="Immat", Width:=50
.ColumnHeaders.Add Text:="Chassis", Width:=50
.ColumnHeaders.Add Text:="Lieu", Width:=50
.ColumnHeaders.Add Text:="Marque", Width:=80
.ColumnHeaders.Add Text:="Type", Width:=80
.ColumnHeaders.Add Text:="Taille", Width:=60
.ColumnHeaders.Add Text:="Charge", Width:=60
.ColumnHeaders.Add Text:="Vitesse", Width:=60
.ColumnHeaders.Add Text:="Saison", Width:=60
.ColumnHeaders.Add Text:="Qté", Width:=25'Affichage dans les textbox
Private Sub AffichageDemande_ItemClick(ByVal Item As MSComctlLib.ListItem)
txtIndex = AffichageDemande.SelectedItem
txtEtat = AffichageDemande.SelectedItem.SubItems(1)
txtDate = AffichageDemande.SelectedItem.SubItems(2)
txtNom = AffichageDemande.SelectedItem.SubItems(3)
txtID = AffichageDemande.SelectedItem.SubItems(4)
txtCA = AffichageDemande.SelectedItem.SubItems(5)
txtImmat = AffichageDemande.SelectedItem.SubItems(6)
txtChassis = AffichageDemande.SelectedItem.SubItems(7)
txtLieu = AffichageDemande.SelectedItem.SubItems(8)
txtMarque = AffichageDemande.SelectedItem.SubItems(9)
txtType = AffichageDemande.SelectedItem.SubItems(10)
txtTaille = AffichageDemande.SelectedItem.SubItems(11)
txtCharge = AffichageDemande.SelectedItem.SubItems(12)
txtVitesse = AffichageDemande.SelectedItem.SubItems(13)
txtSaison = AffichageDemande.SelectedItem.SubItems(14)
txtQte = AffichageDemande.SelectedItem.SubItems(15)
End SubBonjour
Dans la macro Private Sub UserForm_Initialize(), juste en dessous de With AffichageDemande, ajoutez cette ligne
.LabelEdit = 1si ok -->
Cordialement
Yees parfait merci beaucoup encore Dan ! :)