buy now
log in

Q: Is there any way to control in place text editing on per-table or per-cell basis? We have some tables that we don't want any in-place-editing and others that we only want to allow in-place editing of the cell values and not the caption...

A: You can do that by handling the Diagram.NodeTextEditing and Diagram.CellTextEditing events. Set e.Cancel to true to prevent the user from editing the node's text.

Q: How to scroll or to zoom the diagram using the mouse wheel?

A: You can add support for scrolling with the mouse wheel like this:

private void Form1_Load(object sender, 
 System.EventArgs e)


 diagramView.MouseWheel += 
 new MouseEventHandler(diagramView_MouseWheel);


void diagramView_MouseWheel(object sender, 
 MouseEventArgs args)


 diagramView fcSender = sender as diagramView;


 float newScrollY = fcSender.ScrollY - args.Delta / 50;

 if (newScrollY > fcSender.DocExtents.Top)

 fcSender.ScrollY = newScrollY;

This event is inherited from the Control class, but for some reason it does not appear in the event list in the IDE. You must add a handler for it manually. The handler above scrolls the document, but if you wish, you can change that to zoom in/out by altering the DiagramView.ZoomFactor property.

Q: I want to select everything in the chart and move the selection down for a certain amount of dx and dy. Is there a way to easily move an entire selection?

A: Moving a node also moves the link end points, so the easiest solution is to move all items in two phases. First, move all selected nodes - this also offsets the end points of the links. Next, offset all control points of all selected links, except the end points (the end points have been moved with the nodes).

Q: I am using a ControlNode object where I have a TextEditor. How to perform painting while resizing and moving it?

A: Windows sends WM_PAINT messages to controls only when there aren't any other messages in the message queue, so the hosted control is not repainted until you pause moving the mouse. You could force the hosted control to repaint themselves by calling their Refresh method from the NodeModifying event handler.

Q: I divided FlowChart's area in 4 lanes. Is there any event raised upon a left-click on RowHeaders?

A: You could handle the Clicked event and call the GetHeaderFromPoint method to find out whether some header has been clicked.

Copyright © 2001-2022 MindFusion LLC. All rights reserved.
Terms of Use - Contact Us