TaskPane_Resize
(
object sender,
EventArgs e
)
{
// Until version 1.0.1.110, the splLegend SplitContainer control, which
// occupies the entire space beneath the TaskPane's toolbar, had its
// Anchor property set to Top|Left|Right|Bottom. That usually worked
// fine, but in some cases splLegend would end up with a height that
// was greater than the TaskPane's height. That resulted in the graph
// being drawn below the bottom of the graph pane.
//
// Here is one repro case:
//
// 1. Create a graph.
//
// 2. Export the selection to a new workbook.
//
// The new workbook is where the problem could be seen.
//
// Is this a bug in the SplitContainer control? There is at least one
// other easily reproducible layout bug in that control (see the
// comments in splLegend_Panel2_Resize() for details), so that is a
// possibility.
//
// To work around this problem, the Anchor property of splLegend was
// changed to the default Top|Left, and the following code was added to
// do the right and bottom anchoring manually.
splLegend.Size = new Size(this.Width, this.Height - splLegend.Top);
}