Click here to Skip to main content
15,905,782 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using an XML DB in Visual C# Pin
wizfrog17-Nov-07 14:35
wizfrog17-Nov-07 14:35 
GeneralRe: Using an XML DB in Visual C# Pin
Not Active17-Nov-07 16:37
mentorNot Active17-Nov-07 16:37 
QuestionNode List Problem Pin
merrsh197817-Nov-07 11:23
merrsh197817-Nov-07 11:23 
AnswerRe: Node List Problem Pin
wizfrog17-Nov-07 14:42
wizfrog17-Nov-07 14:42 
GeneralRe: Node List Problem Pin
merrsh197817-Nov-07 20:03
merrsh197817-Nov-07 20:03 
GeneralRe: Node List Problem Pin
merrsh197818-Nov-07 9:36
merrsh197818-Nov-07 9:36 
AnswerRe: Node List Problem Pin
Ravi Bhavnani17-Nov-07 16:47
professionalRavi Bhavnani17-Nov-07 16:47 
QuestionTreeView Images (Image Array) Pin
Jeffrey Walton17-Nov-07 10:17
Jeffrey Walton17-Nov-07 10:17 
Hi All,

I have a TreeView for which I have created images. Rather than using a single image per item, I've created an array. So rather than than a 16x16 BMP, I am using an array of 16x16 BMP's. The array includes standard and selected images. They are laid out as [standard, selected] pairs.

I add the image to the the tree view. However, when dispalyed, there are no images. I beieve this is because the control is not performing the derefernce into the array. How do I get the TreeView to properly use the array of images? TreeView uses and ImageList, and the array is a list (I think...).

Jeff

public static ImageList images = new ImageList();
...
images.Images.Add(new Bitmap("TreeViewImages.bmp"));  // 0 - 59
TreeView.ImageList = images;
...
TreeNode node = new TreeNode();
...
int ImageIndex = GetImageIndex(GetTagNumber());
node.ImageIndex = ImageIndex;
node.SelectedImageIndex = ImageIndex + 1;

private static int GetImageIndex(int number)
{
  return ...;
}

QuestionRe: TreeView Images (Image Array) Pin
Jeffrey Walton17-Nov-07 11:04
Jeffrey Walton17-Nov-07 11:04 
QuestionRe: TreeView Images (Image Array) Pin
Jeffrey Walton17-Nov-07 12:10
Jeffrey Walton17-Nov-07 12:10 
AnswerRe: TreeView Images (Image Array) Pin
Jeffrey Walton17-Nov-07 22:34
Jeffrey Walton17-Nov-07 22:34 
AnswerRe: TreeView Images (Image Array) Pin
Luc Pattyn17-Nov-07 12:56
sitebuilderLuc Pattyn17-Nov-07 12:56 
GeneralRe: TreeView Images (Image Array) Pin
Jeffrey Walton17-Nov-07 13:04
Jeffrey Walton17-Nov-07 13:04 
GeneralRe: TreeView Images (Image Array) Pin
Luc Pattyn18-Nov-07 1:26
sitebuilderLuc Pattyn18-Nov-07 1:26 
GeneralRe: TreeView Images (Image Array) Pin
Jeffrey Walton18-Nov-07 2:56
Jeffrey Walton18-Nov-07 2:56 
QuestionFolderBrowser exception Pin
martin_hughes17-Nov-07 9:14
martin_hughes17-Nov-07 9:14 
AnswerRe: FolderBrowser exception Pin
Luc Pattyn17-Nov-07 9:53
sitebuilderLuc Pattyn17-Nov-07 9:53 
GeneralRe: FolderBrowser exception Pin
martin_hughes17-Nov-07 10:28
martin_hughes17-Nov-07 10:28 
QuestionList of Network Connection Pin
Muhammad Nauman Yousuf17-Nov-07 8:02
Muhammad Nauman Yousuf17-Nov-07 8:02 
Questionopen file for writing text(not bytes) and share access Pin
gizmokaka17-Nov-07 7:42
gizmokaka17-Nov-07 7:42 
AnswerRe: open file for writing text(not bytes) and share access Pin
Giorgi Dalakishvili17-Nov-07 8:01
mentorGiorgi Dalakishvili17-Nov-07 8:01 
GeneralRe: open file for writing text(not bytes) and share access Pin
gizmokaka17-Nov-07 8:08
gizmokaka17-Nov-07 8:08 
GeneralRe: open file for writing text(not bytes) and share access Pin
Giorgi Dalakishvili17-Nov-07 8:20
mentorGiorgi Dalakishvili17-Nov-07 8:20 
GeneralRe: open file for writing text(not bytes) and share access Pin
Giorgi Dalakishvili17-Nov-07 9:48
mentorGiorgi Dalakishvili17-Nov-07 9:48 
GeneralRe: open file for writing text(not bytes) and share access Pin
gizmokaka17-Nov-07 8:40
gizmokaka17-Nov-07 8:40 

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.