Hallo samen.
Ik heb een treeview maar als er geen gegevens instaan mag hij niet opslaan.
dus iets als dacht ik maar dit werkt niet.
iemand een idee?
Code:if treeview.nodes Is Nothing Then Msgbox("sla op") End if
Heb het zo opgelost
Code:If treeView1.GetNodeCount(True) Then Select Case MessageBox.Show("Wil je de gegevens opslaan?", "Gas / Electra", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information) Case Windows.Forms.DialogResult.Cancel ' e.Cancel = True Case Windows.Forms.DialogResult.Yes My.Computer.FileSystem.CopyFile(Application.StartupPath & "\Backup\MyDetail.xml", Application.StartupPath & "\Backup\Res_MyDetail.xml", True) Case Else 'Close form (default) End Select End If