Click here to Skip to main content
15,913,941 members
Home / Discussions / C#
   

C#

 
AnswerRe: Please I need your help...How to Work with Graphics in C# Pin
Harvey Saayman20-Sep-08 0:30
Harvey Saayman20-Sep-08 0:30 
GeneralRe: Please I need your help...How to Work with Graphics in C# Pin
Programmer.Nick20-Sep-08 1:44
Programmer.Nick20-Sep-08 1:44 
GeneralRe: Please I need your help...How to Work with Graphics in C# Pin
Harvey Saayman20-Sep-08 1:46
Harvey Saayman20-Sep-08 1:46 
QuestionHow to use asmx file Pin
potter_Anil19-Sep-08 19:46
potter_Anil19-Sep-08 19:46 
AnswerRe: How to use asmx file Pin
DaveyM6919-Sep-08 22:22
professionalDaveyM6919-Sep-08 22:22 
QuestionBackgroundworker with EventWaitHandle no respond???? Pin
mimimimilaw19-Sep-08 16:15
mimimimilaw19-Sep-08 16:15 
AnswerRe: Backgroundworker with EventWaitHandle no respond???? Pin
Nicholas Butler20-Sep-08 0:09
sitebuilderNicholas Butler20-Sep-08 0:09 
QuestionTreeView; adding children to parentNodes assistance needed. Pin
HellTriX19-Sep-08 15:22
HellTriX19-Sep-08 15:22 
First I must state I'm newish to C#. I am/was a decent Perl script kiddy.

I can not seem to locate good tutorials or code examples that help me to build a simple treeview. Some of the ones I have seen are pretty complex that I can't quite grasp it, the other easy ones are so abstract it teaches me nothing about implementation.

I will show what code I have then ask my question below it:
TreeNode parentNode = new TreeNode();
parentNode.Text = "Name";
parentNode.Tag = 1;
parentNode.ExpandAll();
treeView1.Nodes.Add(parentNode);

TreeNode childNode = new TreeNode();
childNode.Text = "Child";
childNode.Tag = 2; //Not sure if I need a Tag for this one.
parentNode.Nodes.Add(childNode);


This creates a very simplistic Parent called "Name" and a Child called "Child".

Questions:
1) This works for creating a single child, but can someone explain to me how I reference the parent specifically to add more children? To rephrase: If I have many Parents, how do I pick one of the parents to add more children?

2) What exactly is the .Tag used for?

3) How do I make a variable or object that would store one specific parent or child so that I could read/write data, or add add children too it?

4) Why is it so hard to find a tutorial or books that contain information about TreeView?

Hope this is appropriate for my first post here.
Thanks,
TriX
AnswerRe: TreeView; adding children to parentNodes assistance needed. Pin
DaveyM6919-Sep-08 22:16
professionalDaveyM6919-Sep-08 22:16 
QuestionHow can we override OnFormClosing method ? Pin
Mohammad Dayyan19-Sep-08 13:09
Mohammad Dayyan19-Sep-08 13:09 
AnswerRe: How can we override OnFormClosing method ? Pin
Mbah Dhaim19-Sep-08 13:44
Mbah Dhaim19-Sep-08 13:44 
GeneralRe: How can we override OnFormClosing method ? Pin
Mohammad Dayyan19-Sep-08 13:52
Mohammad Dayyan19-Sep-08 13:52 
Questionhow can i search in text files by c# Pin
ahmedhassan9619-Sep-08 12:37
ahmedhassan9619-Sep-08 12:37 
AnswerRe: how can i search in text files by c# Pin
Harvey Saayman20-Sep-08 0:57
Harvey Saayman20-Sep-08 0:57 
QuestionConvert swf to exe Pin
Waheed Ur Rehman19-Sep-08 5:50
Waheed Ur Rehman19-Sep-08 5:50 
AnswerRe: Convert swf to exe Pin
Anthony Mushrow19-Sep-08 9:08
professionalAnthony Mushrow19-Sep-08 9:08 
GeneralRe: Convert swf to exe Pin
Waheed Ur Rehman20-Sep-08 2:49
Waheed Ur Rehman20-Sep-08 2:49 
QuestionNamespaces with Web References Pin
Phillip Donegan19-Sep-08 5:39
Phillip Donegan19-Sep-08 5:39 
AnswerRe: Namespaces with Web References Pin
Phillip Donegan21-Sep-08 23:21
Phillip Donegan21-Sep-08 23:21 
Questionmouse hover image Pin
harcaype19-Sep-08 5:19
harcaype19-Sep-08 5:19 
AnswerRe: mouse hover image Pin
John_Adams19-Sep-08 5:46
John_Adams19-Sep-08 5:46 
AnswerRe: mouse hover image Pin
harcaype19-Sep-08 6:43
harcaype19-Sep-08 6:43 
QuestionMonitor internet usage Pin
electriac19-Sep-08 4:57
electriac19-Sep-08 4:57 
AnswerRe: Monitor internet usage Pin
jzonthemtn19-Sep-08 5:00
jzonthemtn19-Sep-08 5:00 
GeneralRe: Monitor internet usage Pin
electriac19-Sep-08 7:57
electriac19-Sep-08 7:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.