Hi ,
1. Change Font of TextNode:
You can use FontStyle property of the TextNode and you can change the font at run time. Please refer to the below code snippet.
Syncfusion.Windows.Forms.Diagram.TextNode txtnode = new TextNode( "SIMPLE FLOW DIAGRAM" );
txtnode.FontStyle.Size = 20;
txtnode.FontStyle.Italic = true;
txtnode.FontStyle.Bold = true;
txtnode.FontStyle.Family = "Cambria";
txtnode.FontColorStyle.Color = Color.Purple;
txtnode.LineStyle.LineColor = Color.Transparent;
txtnode.SizeToText(SizeF.Empty);
txtnode.PinPoint = new PointF(250, 30);
this.diagram1.Model.AppendChild(txtnode);
2. To appoint keys Ctrl + '+' and Ctrl + '-' for scaling diagram:
For scaling the diagram, you have to derive the ZoomTool and override the ProcessMouseUp() method. To catch the Ctrl + '+' and Ctrl+ '-' key, you have to override ProcessCmdKey() method. Please refer to the below code snippet.
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
this.diagram1.Focus();
if (diagram1.ContainsFocus)
{
if (((keyData & Keys.Control) == Keys.Control) && ((keyData & Keys.Oemplus) == Keys.Oemplus))
{
zoomTool = new CustomZoomTool(this.diagram1.Controller);
this.diagram1.Controller.RegisterTool(zoomTool);
this.diagram1.Controller.ActivateTool(zoomTool);
zoomTool.SingleActionTool = false;
zoomTool.ProcessMouseUp(new MouseEventArgs(MouseButtons.Left, 1, 1, 1, 1));
}
if (((keyData & Keys.Control) == Keys.Control) && ((keyData & Keys.OemMinus) == Keys.OemMinus))
{
if (zoomTool != null)
zoomTool.ProcessMouseUp(new MouseEventArgs(MouseButtons.Right, 0, 0, 1, 1));
}
}
return base.ProcessCmdKey(ref msg, keyData);
}
Here is the working sample.
http://websamples.syncfusion.com/samples/Diagram.Windows/F75907/main.htmPlease refer to it and let me know if this helps.
Regards,
Nagaraj