Click here to Skip to main content
15,923,087 members
Home / Discussions / C#
   

C#

 
Questiontreeview copy/paste Pin
xilefxilef15-Sep-05 6:50
xilefxilef15-Sep-05 6:50 
AnswerRe: treeview copy/paste Pin
Chals15-Sep-05 6:51
Chals15-Sep-05 6:51 
GeneralRe: treeview copy/paste Pin
xilefxilef15-Sep-05 7:36
xilefxilef15-Sep-05 7:36 
GeneralRe: treeview copy/paste Pin
Chals15-Sep-05 20:22
Chals15-Sep-05 20:22 
QuestionHow to get the last node of a TreeView Pin
Chals15-Sep-05 6:48
Chals15-Sep-05 6:48 
AnswerRe: How to get the last node of a TreeView Pin
xilefxilef15-Sep-05 6:59
xilefxilef15-Sep-05 6:59 
GeneralRe: How to get the last node of a TreeView Pin
Chals15-Sep-05 20:21
Chals15-Sep-05 20:21 
GeneralRe: How to get the last node of a TreeView Pin
xilefxilef17-Sep-05 9:59
xilefxilef17-Sep-05 9:59 
Well, then you may need to use recursion. You can try something like this to get to the deepest node of the tree:

private void DepthSearch(TreeNodeCollection nodes, int depth)
{
int newDepth = depth;
for(int i = 0; i < nodes.Count; i++)
{
if(nodes[i].NextNode == null)
{
//your code here;
}
newDepth++;
this.TreeSearch(nodes[i].Nodes, newDepth);
}

}

so,

calling DepthSearch(TreeView.Nodes, 0) and inserting code (where it says 'your code') that populates some data structure with the current node and the depth, should give you the ability to compare the depths and choose the deepest node.
AnswerRe: How to get the last node of a TreeView Pin
Rcms Support29-Oct-17 20:02
Rcms Support29-Oct-17 20:02 
QuestionArraylists, Collections &amp; Dictionaries... Pin
raysot77715-Sep-05 5:41
raysot77715-Sep-05 5:41 
AnswerRe: Arraylists, Collections &amp; Dictionaries... Pin
Guffa15-Sep-05 6:18
Guffa15-Sep-05 6:18 
GeneralRe: Arraylists, Collections &amp; Dictionaries... Pin
raysot77715-Sep-05 16:05
raysot77715-Sep-05 16:05 
GeneralRe: Arraylists, Collections &amp; Dictionaries... Pin
Guffa15-Sep-05 20:38
Guffa15-Sep-05 20:38 
QuestionRemoting - Image problem Pin
The Liquidian15-Sep-05 4:30
The Liquidian15-Sep-05 4:30 
AnswerRe: Remoting - Image problem Pin
Judah Gabriel Himango15-Sep-05 7:24
sponsorJudah Gabriel Himango15-Sep-05 7:24 
QuestionUsing WebRequest / WebResponse Pin
Stefan_ Spenz15-Sep-05 3:41
Stefan_ Spenz15-Sep-05 3:41 
AnswerRe: Using WebRequest / WebResponse Pin
Guffa15-Sep-05 3:59
Guffa15-Sep-05 3:59 
AnswerRe: Using WebRequest / WebResponse Pin
surfman1915-Sep-05 9:19
surfman1915-Sep-05 9:19 
QuestionSecurityException running a winApp located on intranet Pin
joaoPaulo15-Sep-05 3:40
joaoPaulo15-Sep-05 3:40 
AnswerRe: SecurityException running a winApp located on intranet Pin
mav.northwind15-Sep-05 5:58
mav.northwind15-Sep-05 5:58 
Questionhow to assign the session variable in javascript Pin
mohd rafi15-Sep-05 3:19
mohd rafi15-Sep-05 3:19 
QuestionaxBrowser + MDIChild problem Pin
g00fyman15-Sep-05 3:12
g00fyman15-Sep-05 3:12 
QuestionDatagrid row selection problem Pin
Wjousts15-Sep-05 2:10
Wjousts15-Sep-05 2:10 
AnswerRe: Datagrid row selection problem Pin
miah alom15-Sep-05 3:52
miah alom15-Sep-05 3:52 
GeneralRe: Datagrid row selection problem Pin
Wjousts15-Sep-05 5:44
Wjousts15-Sep-05 5:44 

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.