Custom control

  • Thread starter Thread starter Trond Hoiberg
  • Start date Start date
T

Trond Hoiberg

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?
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 = "";

}
 
When i click a node in the treeview control, the this.ClearTextFields();
does not run. So the text in the textboxes are not cleared.
Best regards
Trond
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top