#### Archived

This topic is now archived and is closed to further replies.

# [Win32 API]Changing treeview text at runtime

This topic is 6050 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How can I change the text of a treeview item from my program? I don''t mean using the user to edit the label. Is it possible without destroying the item and recreating?

##### Share on other sites
I''ve done this in vb, it should be similar. basically you just set the text of the TreeView.
TreeView.nodes(x).text="something"
that''s what''d look like in vb, should be similar in C++.

Never underestimate the power of stupid people in large groups.

HHSDrum@yahoo.com

##### Share on other sites
Hmmm.
Don't think it is that simple.

I tried some stuff inside
WM_NOTIFY:

tvi = ((NM_TREEVIEW *)lParam)->tviNew;
tvi.pszText = "foobar";

But I don't think that world work. Once the node is created
I think that's it?

Edited by - Clash Rocker on July 28, 2001 10:10:16 AM

##### Share on other sites
Use the message TVM_SETITEM.

Bjørn.