Using Trackbar to Resize a Picture Box

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
metkillerjoe




Wordewatician 500

Posts: 1267
Joined: Thu Aug 03, 2006 3:35 pm
Contact:

Using Trackbar to Resize a Picture Box

Post by metkillerjoe »

I've been trying to use the trackbars in Visual C# Express to resize a picturebox (its for a graphing app I'm making).

Code: Select all

 
private void trackBar1_Scroll(object sender, EventArgs e)
        {
            trackBar1.Value = pictureBox1.Size.Height;
        }

        private void trackBar2_Scroll(object sender, EventArgs e)
        {
            trackBar2.Value = pictureBox1.Size.Width;

        }
The pictureboxes 'Lock' boolean is set to false, so I don't understand why it wouldn't let me resize it.

Thanks in advance.
Image
User avatar
xzodia




Translator Connoisseur Coagulator

Posts: 1981
Joined: Sun May 15, 2005 10:31 am
Location: UK
Contact:

Re: Using Trackbar to Resize a Picture Box

Post by xzodia »

Code: Select all

 
private void trackBar1_Scroll(object sender, EventArgs e)
        {
            pictureBox1.Size.Height =  trackBar1.Value;
        }

        private void trackBar2_Scroll(object sender, EventArgs e)
        {
            pictureBox1.Size.Width = trackBar2.Value;

        }
Image
Halo 2 Plugins | Lock-on To Just About Anything | My Sites | Snow Hog
Old Plugins you have, upgrade you must...
Always Maintain a High Quality-To-Crap Ratio.
Post Reply