2

How can I access the event that is triggered when a graph pane is resized?

After each resize, I want to fix the text size on the title and labels so they don't get huge when the window is maximized.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sooprise
  • 22,657
  • 67
  • 188
  • 276

1 Answers1

7

You can subscribe for ZedGraphControl's resize event:

zg1.Resize += new EventHandler(zg1_Resize);

But it's easier to achieve what you want by disabling the automatic font scaling on the GraphPane:

zg1.MasterPane[0].IsFontScaled = false;

If you have more than one GraphPane on your MasterPane, use:

 foreach(GraphPane pane in zg1.MasterPane.PaneList)
    pane.IsFontScaled = false;

See also:
http://zedgraph.org/wiki/index.php?title=How_does_the_font_and_chart_element_scaling_logic_work%3F http://zedgraph.sourceforge.net/documentation/html/P_ZedGraph_PaneBase_IsFontsScaled.htm

Gacek
  • 10,184
  • 9
  • 54
  • 87