Click here to Skip to main content
15,897,291 members
Home / Discussions / C#
   

C#

 
QuestionProblem in setting icon to TreeView Control Pin
freshonlineMax29-Apr-06 20:27
freshonlineMax29-Apr-06 20:27 
Hello Friends
From 2 days ago i'm trying to show icons for treeview nodes programmatically. but i was failed.
I have an ImageList with 2 16*16 icons.
I have a TreeView Control too.
I'm writing codes like below and I can see nodes, But i can't see any icon, I searched so many references in WebPages,but they confused me.
<br />
treeView1.ImageList = imageList1;<br />
for (int i = 0; i < 4; ++i)<br />
{<br />
TreeNode n = new TreeNode("Node with image " + i.ToString());<br />
n.ImageIndex = 0;<br />
n.SelectedImageIndex = 1;<br />
treeView1.Nodes.Add(n);<br />
}	<br />

Please help me.
Thank You.


-- modified at 5:12 Sunday 30th April, 2006
AnswerRe: Problem in setting icon to TreeView Control Pin
tarasn29-Apr-06 22:39
tarasn29-Apr-06 22:39 
GeneralRe: Problem in setting icon to TreeView Control Pin
freshonlineMax29-Apr-06 23:17
freshonlineMax29-Apr-06 23:17 
AnswerRe: Problem in setting icon to TreeView Control Pin
Ravi Bhavnani30-Apr-06 0:55
professionalRavi Bhavnani30-Apr-06 0:55 
AnswerRe: Problem in setting icon to TreeView Control Pin
S. Senthil Kumar30-Apr-06 3:29
S. Senthil Kumar30-Apr-06 3:29 
GeneralRe: Problem in setting icon to TreeView Control Pin
freshonlineMax30-Apr-06 23:04
freshonlineMax30-Apr-06 23:04 
QuestionWhere are these namespaes? Pin
mehrdadc4829-Apr-06 20:13
mehrdadc4829-Apr-06 20:13 
AnswerRe: Where are these namespaes? Pin
CWIZO29-Apr-06 23:26
CWIZO29-Apr-06 23:26 
AnswerRe: Where are these namespaes? Pin
S. Senthil Kumar30-Apr-06 3:30
S. Senthil Kumar30-Apr-06 3:30 
QuestionNull reference exception Pin
lagumaster29-Apr-06 18:32
lagumaster29-Apr-06 18:32 
AnswerRe: Null reference exception Pin
Robert Rohde29-Apr-06 20:11
Robert Rohde29-Apr-06 20:11 
GeneralRe: Null reference exception Pin
lagumaster2-May-06 15:49
lagumaster2-May-06 15:49 
QuestionShow main form in C# Pin
leanhsang29-Apr-06 17:31
leanhsang29-Apr-06 17:31 
AnswerRe: Show main form in C# Pin
S. Senthil Kumar30-Apr-06 3:35
S. Senthil Kumar30-Apr-06 3:35 
QuestionNo Custom paint in design time Pin
Mark0629-Apr-06 15:50
Mark0629-Apr-06 15:50 
AnswerRe: No Custom paint in design time Pin
Robert Rohde29-Apr-06 20:14
Robert Rohde29-Apr-06 20:14 
QuestionClosing another program Pin
gokhangs29-Apr-06 12:38
gokhangs29-Apr-06 12:38 
AnswerRe: Closing another program Pin
Robert Rohde29-Apr-06 20:18
Robert Rohde29-Apr-06 20:18 
QuestionList Boxes Pin
TippyMoe29-Apr-06 11:56
TippyMoe29-Apr-06 11:56 
AnswerRe: List Boxes Pin
Sean8929-Apr-06 13:19
Sean8929-Apr-06 13:19 
GeneralRe: List Boxes Pin
TippyMoe2-May-06 8:20
TippyMoe2-May-06 8:20 
AnswerRe: List Boxes Pin
Kuira1-May-06 14:14
Kuira1-May-06 14:14 
GeneralRe: List Boxes Pin
TippyMoe2-May-06 8:21
TippyMoe2-May-06 8:21 
QuestionLoop Issue Pin
teejayem29-Apr-06 10:14
teejayem29-Apr-06 10:14 
AnswerRe: Loop Issue Pin
Rob Graham29-Apr-06 10:25
Rob Graham29-Apr-06 10:25 

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.