If there is any one point to this, it is a very basic tutorial of MS Visual BASIC 05/08.
The process and code are very simple and Visual BASIC 2005 or 2008 can be used. Download the example to see how it should work if you run into any difficulties.
1. Add two scroll bars (I used one vertical and one horizontal), four progress bars and two picture boxes (dimensions set to a size of 1,1) to a blank form. Assign an image to each picture box.
2. Add the following code to the scroll event of one of the scroll bars:
ProgressBar1.Value = VScrollBar1.Value
ProgressBar2.Value = VScrollBar1.Value
ProgressBar3.Value = VScrollBar1.Value
ProgressBar4.Value = VScrollBar1.Value
HScrollBar1.Value = VScrollBar1.Value
PictureBox1.Height = (VScrollBar1.Value * 1.3)
PictureBox2.Width = (HScrollBar1.Value * 1.3)
And this to the scroll event of the other scroll bar:
ProgressBar1.Value = VScrollBar1.Value
ProgressBar2.Value = VScrollBar1.Value
ProgressBar3.Value = VScrollBar1.Value
ProgressBar4.Value = VScrollBar1.Value
VScrollBar1.Value = HScrollBar1.Value
PictureBox1.Width = (HScrollBar1.Value * 1.3)
PictureBox2.Height = (VScrollBar1.Value * 1.3)
3. And that’s it! Have a little play and see what happens to the picture boxes when you drag each scrollbar. Add bits, play around with it. There are a large number of toolbox items that use the ‘value’ field that can be easily added to this. Go wild – there are no boundaries to a program without any purpose!
0 responses:
Post a Comment
Insulting, abusive or obscene content will be removed. Replies from non-members will be approved before being displayed.