Hi Guys......
I am new to this website and found it really good when it comes to problem solving and concept clearing...
I am facing a problem..
I have used multiselect option of the openfiledialog, but I am unable to write the result of this in a RichTextBox or a ComboBox or a ListBox or a TreeView...
- What I want to do exactly is that any of the above mentioned controls show the FileNames of the files that have been selected by the user in the openfiledialog..
Please Help !!!
Chitkaran Singh

Chitkaran SinghPosted Nov 11, 2007, 1:38 PM
Hey Alan...
Thanks for showing me the way Sir,,
Actually, the zoom propety worked for me in this case,,, But ur the one who showed me the way...
Thanks again Sir.
AlanPosted Nov 11, 2007, 1:24 PM
Chitkaran SinghPosted Nov 11, 2007, 1:16 PM
Oh thats really worked... Thanx Allan..
Just a simple think I wanna ask...
When I click on the node and place the corresponding image in the pictire box, it goes beyond the limits of the picture box..
So is there a way with which I can specity that irrespective of the actual size of the image, it stays in the limits of the pictore box, or the size that I specify.. ???
AlanPosted Nov 11, 2007, 11:22 AM
Perhaps the selected node has no child nodes and hence its Nodes property is null?
But, even if it has, then you won't get anything meaningful from its ToString() method - just the name of the type which will be System.Windows.Forms.TreeNodeCollection or something like that.
If the node which has been clicked has a label which represents the path of the image you want to place in the picturebox, then I'd try:
pictureBox1.ImageLocation = e.Node.Text;
Chitkaran SinghPosted Nov 11, 2007, 10:23 AM
private
void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e){
pictureBox1.ImageLocation = treeView1.SelectedNode.Nodes.ToString();
//MessageBox.Show(treeView1.SelectedNode.Nodes.ToString());}
Gives an exception..
{"Object reference not set to an instance of an object."}
AlanPosted Nov 7, 2007, 8:59 AM
Assuming you've set the RichTextBox's Multiline property to true, then the code to list the file names within it would be something like this:
DialogResult dr = openFileDialog1.ShowDialog();
if (dr == DialogResult.OK)
{
richTextBox1.Text = String.Join("\r\n", openFileDialog1.FileNames);
}