2.2.3.17.39 TreeNode::SetNodeText

Description

It sets the value of the node as string by assuming the supplied code page (if >= 0) when converting to Unicode.

Syntax

BOOL SetNodeText( LPCSTR lpcszVal, int nCodePage = -1 )

Parameters

lpcszVal
[input] string value
nCodePage
[input,optional] the code page to use if >= 0.

Return

Examples

EX1

void TreeNode_SetNodeText_ex1()
{
    Tree tr;
    TreeNode tn1;
    tn1 = tr.AddTextNode("abc", "node1", 1);// tr add text node
    tn1.AddTextNode("def", "node11", 11);	// tn1 add text node
    out_tree(tr);							// Output tr
    
    out_str( tn1.GetNodeText() );			// Get tn1 node text
    tn1.SetNodeText("NewNodeText");			// Set new text to tn1
    out_str( tn1.GetNodeText() );			// Output tn1 text
}

Remark

See Also

TreeNode::GetNodeText

Header to Include

origin.h