Selasa, 13 Agustus 2013

hScrollBar C#

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

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

        }

        private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
        {
            textBox1.Text = hScrollBar1.Value.ToString();
           
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           
            hScrollBar1.Maximum = 100;
            hScrollBar1.Value = 0;
            hScrollBar1.Minimum = 0;
          hScrollBar1.ValueChanged += new EventHandler(hScrollBar1_ValueChanged);
        }

        void hScrollBar1_ValueChanged(object sender, EventArgs e)
        {
            textBox2.Location = new Point(hScrollBar1.Value,64);
            //throw new NotImplementedException();
        }
    }
}