News: IceChat 7.63 (20080417) released.
IceChat 2009 SVN setup at http://icechat.codeplex.com
Manual Forum Registration still in place
 
*
Welcome, Guest. Please login or register. September 09, 2010, 01:40:03 PM


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: MouseWheel for NickList Control.  (Read 265 times)
invisal
Newbie
*
Posts: 1


« on: May 11, 2010, 12:11:19 PM »

NickList Control currently does not support mouse wheel. So, I decided to make a small modification to your code.

NickList.cs
Code:
        private void OnMouseWheel(object sender, MouseEventArgs e)
        {
            if (vScrollBar.Enabled == true)
            {
                if (e.Delta < 0)
                {
                    if (vScrollBar.Maximum < (vScrollBar.Value + 2))
                    {
                        vScrollBar.Value = vScrollBar.Maximum;
                    } else {
                        vScrollBar.Value += 2;
                    }
                } else if (e.Delta > 0) {
                    if (0 > (vScrollBar.Value - 2))
                    {
                        vScrollBar.Value = 0;
                    }
                    else
                    {
                        vScrollBar.Value -= 2;
                    }
                }

                topIndex = vScrollBar.Value;
                Invalidate();
            }
        }

NickList.Design.cs
Code:
....
this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.OnMouseWheel);
....

I hope that will help.
Logged
Snerf
IceChat Coder
Administrator
Hero Member
*****
Posts: 1672


WWW
« Reply #1 on: May 11, 2010, 01:52:35 PM »

Thank you very much, I will add this into the next Alpha release (14.2).
Logged

The IceChat God
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Copyright © IceChat Networks 2000-2010. All Rights Reserved.
Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM