TreeView Help

Posts 1–14 of 14 · Page 1 of 1
TreeView Help
Hi.

I need help with 2 things.

1. I've put a lot of roots and childs in a treeview so i need to add a search button.

2. i want to be able to copy the root or the child.


plz can someone tell me how?
Hmmm, more info please. Where what and why do you need to copy.
I need to copy a cd-key (its a child) of the treeview. Like I want to right click the root or child and be able to select copy to clipboard.
Quote Originally Posted by ModelCookie2 View Post
I need to copy a cd-key (its a child) of the treeview. Like I want to right click the root or child and be able to select copy to clipboard.
From The Toolbox add "ContextMenuStrip" to your form. Add "Copy To Clipboard" on it. Then select the treeview and in properties box find "ContextMenuStrip". It will be a drop down list so select the ContextMenuStrip you added earlier. This will bind the ContextMenuStrip to your treeview. Now when you will right click the treeview's roots or childs it will show "Copy To Clipboard."
Thanks a lot! And whats the code to make it copied?


And what about the search button?
My.computer.clipboard.settext(string)
It says Overload resolution failed because no accessible 'SetText' accepts this number of type arguments.
Quote Originally Posted by ModelCookie2 View Post
It says Overload resolution failed because no accessible 'SetText' accepts this number of type arguments.
What are you trying to copy ?

Code:
Clipboard.settext("Somestringvalue")
should work fine, given the value copied is a string value.
Quote Originally Posted by Hassan View Post


What are you trying to copy ?

Code:
Clipboard.settext("Somestringvalue")
should work fine, given the value copied is a string value.

I add Clipboard.settext("Somestringvalue") to my "Copy To Clipboard"?
and what do i put in "somestringvalue"? SelectedTreeNode?
Quote Originally Posted by ModelCookie2 View Post
I add Clipboard.settext("Somestringvalue") to my "Copy To Clipboard"?
and what do i put in "somestringvalue"? SelectedTreeNode?
To copy the selected treeview node text to clipboard use the following code:

Code:
TreeView1.SelectedNode.text
Should Work !!
Quote Originally Posted by ModelCookie2 View Post
Thanks a lot guys!!
No problem. Any time xD !!
but what about the search button?
What about it?
Posts 1–14 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?