How to shorten two methods with the same theme?
Something along these lines:

private void ValueChangedImp(object sender, EventArgs e, Func&lt;int&gt; get_value, Action&lt;Layer, int&gt; set_value, Func&lt;int&gt; get_pixels)
{
    if (ignoreChange) return; // Sometimes I only want to change the value without the event firing (like when undo-ing)

    PushUndoStack();

    int value = get_value();

    foreach (Layer layer in doc.TileLayers)
        set_value(laywe, value);

    hscDoc.Maximum = get_pixels();
    ClampScrollbarValue(hscDoc);
}

private void numWidth_ValueChanged(object sender, EventArgs e)
{
    ValueChangedImp(sender, e, () =&gt; (int)numWidth.Value, (layer, value) =&gt; layer.Width = value, () =&gt; doc.WidthInPixels);
}

private void numHeight_ValueChanged(object sender, EventArgs e)
{
    ValueChangedImp(sender, e, () =&gt; (int)numHeight.Value, (layer, value) =&gt; layer.Height = value, () =&gt; doc.HeightInPixels);
}