c#滚动条控件的应用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/a454335066/article/details/53587990


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ccccccccccccc
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void HandleScrool(object sender, ScrollEventArgs e)
        {

        }

        private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
        {
            Graphics g = pictureBox1.CreateGraphics();
            g.DrawImage(pictureBox1.Image, new
             Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height),
             new Rectangle(hScrollBar1.Value, vScrollBar1.Value,
             pictureBox1.Width, pictureBox1.Height), GraphicsUnit.Pixel);
                
        }
    }
}


展开阅读全文

没有更多推荐了,返回首页