Let scroll wheel work when mouse-over on combobox + numeric up/down

Related to #7200
This commit is contained in:
niksedk 2023-09-16 09:37:47 +02:00
parent be53ef93f6
commit 86895306e0
3 changed files with 37 additions and 1 deletions

View File

@ -520,7 +520,7 @@ namespace Nikse.SubtitleEdit.Controls
MouseWheel += (sender, e) => MouseWheel += (sender, e) =>
{ {
if (_textBox == null || !(_textBox.Focused || base.Focused)) if (_textBox == null || _listViewShown)
{ {
return; return;
} }

View File

@ -7,6 +7,7 @@ using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Globalization; using System.Globalization;
using System.Windows.Forms; using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Nikse.SubtitleEdit.Controls namespace Nikse.SubtitleEdit.Controls
{ {
@ -316,6 +317,23 @@ namespace Nikse.SubtitleEdit.Controls
AddValue(0); AddValue(0);
}; };
MouseWheel += (sender, e) =>
{
if (_maskedTextBox == null)
{
return;
}
if (e.Delta > 0)
{
AddValue(-Increment);
}
else if (e.Delta < 0)
{
AddValue(Increment);
}
};
TabStop = false; TabStop = false;
_loading = false; _loading = false;

View File

@ -309,6 +309,24 @@ namespace Nikse.SubtitleEdit.Controls
}; };
LostFocus += (sender, args) => _repeatTimer.Stop(); LostFocus += (sender, args) => _repeatTimer.Stop();
MouseWheel += (sender, e) =>
{
if (_textBox == null)
{
return;
}
if (e.Delta > 0)
{
AddValue(-Increment);
}
else if (e.Delta < 0)
{
AddValue(Increment);
}
};
TabStop = false; TabStop = false;
} }