Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem with removing default text in ShapeNode (Read 1995 times)
nezzy
YaBB Newbies
*
Offline



Posts: 25
Joined: May 31st, 2010
Problem with removing default text in ShapeNode
Sep 1st, 2010 at 3:21pm
Print Post  
Hi.
I have an application that sets the text of the shapenode to "Enter description" when a shapenode is created.
When I dubbelclick on the shapenode I use the EnterInPlaceEditMode event to remove this text from the shapenode. This is done so the user dont have to remove the text. But I cant get the text to be removed.
What Im I missing?
Regards
Anders
Code
Select All
private void OnNodeCreated(object sender, NodeEventArgs e)
{
    ShapeNode sNode = (ShapeNode)e.Node;
    sNode.Text = "Enter description";
}

private void diagram_EnterInplaceEditMode(object sender, InPlaceEditEventArgs e)
{
    ShapeNode sNode = (ShapeNode)e.Node;
    if (sNode.Text == "Enter description")
        sNode.Text = ""; //Remove default text
    string myTextToEdit = e.Item.GetTextToEdit(); //Here the text is removed, but in the box on the screen is the text still there
}
 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with removing default text in ShapeNod
Reply #1 - Sep 1st, 2010 at 4:35pm
Print Post  
Hi,

The edit box' text is already set when this event is raised. Set e.TextBox.Text = "" to clear it.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
nezzy
YaBB Newbies
*
Offline



Posts: 25
Joined: May 31st, 2010
Re: Problem with removing default text in ShapeNod
Reply #2 - Sep 2nd, 2010 at 6:50am
Print Post  
Many thanks.
It works nicely.
Regards,
Anders
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint