日期:2014-05-17  浏览次数:20920 次

鼠标滚轮移动不想让滚动条移动,怎么写代码
我操作鼠标滚轮 放大我画的矢量图形,但是不想让滚动条动
我直接把图画在Form1中,没有其他控件

private void Form1_Paint(object sender, PaintEventArgs e)
        {

            Graphics dc = e.Graphics;
            dc.PageScale = more;
            dc.TranslateTransform(this.AutoScrollPosition.X, this.AutoScrollPosition.Y);
            for (int i = 0; i < 400; ++i)
            {
                for (int j = 0; j < 400; ++j)
                {
                    switch (txt[i, j])
                    {
                        case '.':
                            draw(dc, Brushes.Gray, j, i);  //灰色
                            break;
                        case '0':
                            draw(dc, Brushes.White, j, i);  //白色
                            break;
                        case '1':
                            draw(dc, Brushes.LightBlue, j, i);  //浅蓝色
                            break;
                        case '9':
                            draw(dc, Brushes.DarkBlue, j, i);  //深蓝色
                            break;
                        default:
        &nb