ComboBox Scrollwheel disable
C#
4
Posts
2
Posters
0
Views
1
Watching
-
Hello, Is there any way to disable the scrollwheel function for a ComboBox? Thanks R.Myers
-
Hello, Is there any way to disable the scrollwheel function for a ComboBox? Thanks R.Myers
This works!
namespace WindowsFormsApplication1
{
public partial class Form1 : Form, IMessageFilter
{
private const int WM_MOUSEWHEEL = 0x20A;
public bool PreFilterMessage(ref Message m)
{
if (m.Msg == WM_MOUSEWHEEL && this.ActiveControl == comboBox1)
{
return true;
}return false; } public Form1() { InitializeComponent(); } private void Form1\_Load(object sender, EventArgs e) { Application.AddMessageFilter(this); } }
}
-
This works!
namespace WindowsFormsApplication1
{
public partial class Form1 : Form, IMessageFilter
{
private const int WM_MOUSEWHEEL = 0x20A;
public bool PreFilterMessage(ref Message m)
{
if (m.Msg == WM_MOUSEWHEEL && this.ActiveControl == comboBox1)
{
return true;
}return false; } public Form1() { InitializeComponent(); } private void Form1\_Load(object sender, EventArgs e) { Application.AddMessageFilter(this); } }
}