i want to create a form which has a picture box with ten images...
if the image is bigger than the picture box, then a horizontal or vertical scroll bars will appear.
i need a code for both scroll bars...just a simple code will do...
please...need this for my projects...
any help will be much appreciated...
the problem that i posted above is for my project. we are not allowed to use autoscroll for scrolling images that's why i said:
"i want to use a scroll bar in my VB.net form but with the AUTOSCROLL = false..."
so we have to create our own simple code for both Hscroll and Vscroll.
luckily, i manage to create a very simple code for Hscroll. here it is:
Dim y as Integer
Dim pic(28) As Image
y = VScrollBar1.Value
If VScrollBar1.Value <= y Then
y += 1
Select Case y
Case 1 : PictureBox1.Image = My.Resources.a
Case 2 : PictureBox1.Image = My.Resources.b
Case 3 : PictureBox1.Image = My.Resources.c
Case 4 : PictureBox1.Image = My.Resources.d
Case 5 : PictureBox1.Image = My.Resources.e
y -= 1
what i did is that i created a variable to hold the Value of HscrollBar1 and sort of attach the values of images to it. that's why whenever the scrollbar scrolls, so does the images.
it's very simple but convenient to use for my project. i hope that this simple solution will help others who have the same problem. but if you have a better code than this, please let me know.
the solution that i posted just now is for scrolling images as in one by one. i haven't found a simple code yet for scrolling images bigger than the picture box. if you have code, i'll be glad to have it...
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...