Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Capturing Enter as trigger for EndInplaceEdit (Read 1453 times)
pelion
Junior Member
**
Offline



Posts: 61
Joined: Nov 12th, 2006
Capturing Enter as trigger for EndInplaceEdit
Apr 5th, 2007 at 4:49am
Print Post  
I have a box acting as a label, and have a few events allowing the user to edit the text with BeginInplaceEdit()

This, by default, appears to allow users to user the Enter key for a new line as text, which I don't wont. The most intuitive use for the Enter key in my application would be to stop editing.

I have tried to capture the KeyDown event to capture the Enter key, but this is only on the FlowChart, not the Box, and doesn't appear to bubble up.

Any thoughts that could assist me?
Thanks
  
Back to top
 
IP Logged
 
pelion
Junior Member
**
Offline



Posts: 61
Joined: Nov 12th, 2006
Re: Capturing Enter as trigger for EndInplaceEdit
Reply #1 - Apr 5th, 2007 at 4:52am
Print Post  
Through searching further through the forums I found the

Code
Select All
internal static SizeF getLineSize(FlowChart fc, String s, Font f)

  {


Graphics g = fc.CreateGraphics();


g.PageUnit = fc.MeasureUnit;


SizeF size = g.MeasureString(s, f);


g.Dispose();


return size;

  }  



function. This, along with realigning the label to the center of the image, when the text changes, works great.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Capturing Enter as trigger for EndInplaceEdit
Reply #2 - Apr 5th, 2007 at 5:14am
Print Post  
Try setting the InplaceEditAcceptOnEnter property.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint