Skip to content

Pressing Alt+Tab to switch to another window turns on the zoom selection mode  #4103

@Max-i-m

Description

@Max-i-m

I see this bug with the WinForms control (version 5.0.37)

Using Alt+Tab to change the active window, turning on the zoom selection mode but does not turn it off because the window looses focus and never gets the Alt KeyUp event. When the user returns back to the original window, it stays in the selection mode and instead of dragging the chart using mouse, it draws the red zoom selection rectangle.

Temporary Fix

Before this bug is fixed in the library, one can use the following hack to simulate 'Alt' key up event when the window is re-activated:

private void Form1_Activated(object sender, EventArgs e) {
    // Hack: send Alt key up event to turn off the selection mode
    winFormsPlot.Interaction.KeyUp(ScottPlot.Control.Key.Alt);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions