1
Answer

User control

trond 0

trond 0

20y
1.6k
1
I have made an usercontrol TreeView (cusom). Then i dragged it from the toolbar into a form. I then added som code but it does not work (below). Is it because it is a usercontrol? As you can see from the code below i am passing filepath to the TreeView.RootFolder. In OnSelectFile i am "catching" the fact that the user clicked on one of the nodes in the treeview control. So ClearTextFields() should clear all textboxes in the form. But nothing happends. Anyone? With nothing i mean that the textboxes are not cleared. Best regards Trond private void frmFileBrowser_Load(object sender, System.EventArgs e) { TreeView1.RootFolder= @"C:\Logfiles\"; } private void OnSelectFile(object sender, System.Windows.Forms.TreeViewEventArgs e) { this.ClearTextFields(); } private void ClearTextFields() { txtVer.Text = ""; txtID.Text = ""; txtTag.Text = ""; txtDate.Text = ""; txtTime.Text = ""; txtDuration.Text = ""; }
Answers (1)