0

How to call a comboBox1_SelectedIndexChanged(object sender, EventArgs e) method from this code:

private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
	{		
		// Get subdirectories from disk, add to treeView1 control
		AddDirectories(e.Node);		

		// if node is collapsed, expand it. This allows single click to open folders.
		treeView1.SelectedNode.Expand();			
		
		// Get files from disk, add to listView1 control
                //IT SHOULD BE HERE!!!
		AddFiles(e.Node.FullPath.ToString());
		statusBar1.Text = iDirectories.ToString() + " Folder(s)  " + iFiles.ToString() + " File(s)";
	}

I have a code there which will Add selected files.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by DdoubleD
0

Hello.
All you need is decide what objects to pass to that method and then - call it. E.g.:

comboBox1_SelectedIndexChanged(comboBox1, new EventArgs());

Edited by Antenka: n/a

0

If you set the comboBox1.SelectedIndex to a value, it will call the event handler automagically...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.