Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi to all,

 

when i double click in my tree view i change the image that displays, indicating a diferente state of that node. The images are in my imageList, and by default the images index is 0.

 

Ok. So far so good. I have 2 main problems that are tied together.

 

1) When i double click the image change only appears when i select another node.

 

2) When i select a node, the image reverts back to the image that existes by default. When i select another node the image returns to what i had there.

 

 

so what can i do to 1) change the image imediatly when i double click the node and 2) how can i, when i select a node, prevent i to revert to the original image

 

 

thx to all

Posted

so after some struggle with the treeview i resolved the problem only to create a new one.

 

For the 1) problema when i double clik it automaticly changes the image to the next in the image list so its done

 

for the 2) problem when i interare throught the nodes in the tree view it no longer changes to the default image of the tree view so its done.

 

 

To resolve the problems abouve i have to do this

 

private void trvModulos_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
      if (this.trvModulos.SelectedImageIndex != e.Node.ImageIndex)
      {
this.trvModulos.SelectedImageIndex = e.Node.ImageIndex;
      }
}

 

basicly what i do is change the defaut tree view imagem for the one that the node contains. But the problem is that this refreshes the entire tree view closing all expanded nodes and blinks a little making it wierd.

 

Is there any way to stop the tree view to refresh when i do this ??

 

this.trvModulos.SelectedImageIndex = e.Node.ImageIndex;

 

 

thx for the help

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...