[Zedgraph] Auswahlbereich farbig markieren

public bool bMouseDown = false; // Merker für Status des Mousebuttons
public BoxObj boSelection; // Auswahlbox
public double dBoxSelectionStartX; // Startwert für x bei MouseDown

private void Form1_Load(object sender, EventArgs e)
{
    GraphPane myPane = zedGraph.GraphPane;

    // Zoom ausschalten, damit man die Auswahl verschieben kann
    zedGraph.IsEnableHZoom = false;
    zedGraph.IsEnableVZoom = false;
    
    // andere Kurvenelemente malen
    ...

    // vertikale Auswahlbox erzeugen
    boSelection = new BoxObj(100, 0, 30, 1, Color.Empty, Color.Empty);
    boSelection.Fill = new Fill(Color.White, Color.FromArgb(100, Color.LightGreen), 45.0F); // hellgrün, durchsichtig
    boSelection.ZOrder = ZOrder.E_BehindCurves; // hinter den Kurven
    boSelection.IsClippedToChartRect = true; // Box nur im Bereich des Charts malen
    boSelection.Location.CoordinateFrame = CoordType.XScaleYChartFraction; // und über den gesamten Wertebereich (y) malen
    boSelection.IsVisible = false; // noch nicht anzeigen
    myPane.GraphObjList.Add(boSelection);

    zedGraph.AxisChange();
}

private bool zgc_MouseDownEvent(ZedGraphControl sender, MouseEventArgs e)
{
    bMouseDown = true;

    PointF mousePt = new PointF(e.X, e.Y);
    GraphPane pane = sender.MasterPane.FindChartRect(mousePt);

    if (pane != null)
    {
        double x, y;
        pane.ReverseTransform(mousePt, out x, out y);

        dBoxSelectionStartX = x; // Startkoordinaten merken

        boSelection.IsVisible = true; // Box anzeigen
    }
            
    DrawBox(sender, e);
    return false; 
}

private bool zgc_MouseUpEvent(ZedGraphControl sender, MouseEventArgs e)
{
    bMouseDown = false;

    //boSelection.IsVisible = false; // evtl. einkommentieren, damit Box wieder verschwindet
    //this.Refresh();

    return false; 
}

private bool zgc_MouseMoveEvent(ZedGraphControl sender, MouseEventArgs e)
{
    if (bMouseDown) DrawBox(sender, e);
    return false;
}

private void DrawBox(ZedGraphControl sender, MouseEventArgs e)
{
    PointF mousePt = new PointF(e.X, e.Y);
    GraphPane pane = sender.MasterPane.FindChartRect(mousePt);

    if (pane != null)
    {
        double x, y;
        pane.ReverseTransform(mousePt, out x, out y);

        if (x < dBoxSelectionStartX)
        {
            // wenn Maus links des Startpunktes, dann Box nach links zum akt. x-Wert
            // der Auswahl verschieben und bis zum Startpunkt malen
            boSelection.Location.X = x;
            boSelection.Location.Width = x - dBoxSelectionStartX;
        }
        else
        {
            // sonst Box ab Startpunkt nach rechts bis zum akt. x-Wert der Auswahl malen
            boSelection.Location.X = dBoxSelectionStartX;
            boSelection.Location.Width = x - boSelection.Location.X;
        }

        this.Refresh();
    }
}