Do I have to pinvoke to do this?
I tried
But I think thats only for controls with a vertical scroll bar. Picturebox does not seem to fire the OnMouseWheel event....... Any ideas on how to do this in managed code?Code:public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { myPictureBox x = new myPictureBox(); x.Dock = DockStyle.Fill; this.Controls.Add(x); } } public class myPictureBox : PictureBox { protected override void WndProc(ref Message m) { base.WndProc(ref m); if (m.Msg == 0x115) { if (m.WParam.ToInt32() < 0) { } else { } } } }




Reply With Quote