Brothers Inserito: 28 settembre 2005 Segnala Inserito: 28 settembre 2005 Devo aggiungere dei nodi/indirizzi ad un controllo TreeView e quando un nodo è già presente devo visualizzare un MsgBox.Ho provato con questo codice ma mentre con una listBox fungecon un controllo TreeView non mi funziona, le proprietà sono differenti e non sò quale usare.Se qualcuno mi può aiutare ringraziamenti anticipati.Codice pulsante------------------------------ On Error Resume Next Dim sText As String Dim x As Integer Dim I As Integer Dim nodX As Node ' Aggiunge il codice e il nome del dipendente. msg = List1.ItemData(List1.ListIndex) & " " msg = msg & List1.List(List1.ListIndex) Label1.Caption = msg TreeView1.ImageList = ImageList1 If Trim(Text2.Text) = "" Then Exit Sub sText = Trim(Text2.Text) For x = 0 To TreeView1.Nodes.Count - 1 If TreeView1.Nodes.Item(x) = sText Then MsgBox "L'indirizzo " & Chr$(13) _ & Chr$(13) & Text2.Text & Chr$(13) _ & Chr$(13) & " Esiste già", vbInformation, App.Title Exit Sub End If Next x Set nodX = Trim(TreeView1.Nodes.Add(List1.ItemData(List1.ListIndex), tvwChild, , Text2.Text, 1)) For I = 0 To TreeView1.Nodes.Count - 1 If TreeView1.Nodes.Item(I) = sText Then Exit For End If Next I-------------------------------------------
Messaggi consigliati
Crea un account o accedi per commentare
Devi essere un utente per poter lasciare un commento
Crea un account
Registrati per un nuovo account nella nostra comunità. è facile!
Registra un nuovo accountAccedi
Hai già un account? Accedi qui.
Accedi ora