473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Picture Box Slide Show

I have 6 radio buttone and a picture box. I am trying to figure out how to make it so when you click the radio button the image will display in the Picture Box. Any halp would be super.
Nov 5 '06 #1
2 12658
albertw
267 100+
hi

try something like:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Option1_Click(Index As Integer)
  3. Picture1.Picture = LoadPicture()
  4. Select Case Index
  5. Case Is = 0: Picture1.Picture = LoadPicture(App.Path & "\Picure1.bmp")
  6. Case Is = 1: Picture1.Picture = LoadPicture(App.Path & "\Picure2.gif")
  7. Case Is = 2: Picture1.Picture = LoadPicture(App.Path & "\Picure3.jpg")
  8. Case Is = 3: Picture1.Picture = LoadPicture(App.Path & "\Picure4.jpg")
  9. Case Is = 4: Picture1.Picture = LoadPicture(App.Path & "\Picure5.bmp")
  10. Case Is = 5: Picture1.Picture = LoadPicture(App.Path & "\Picure6.gif")
  11. End Select
  12. End Sub
  13.  
  14.  
note that the size of a picturebox is fixed which is not the case with an image.
simply replace the word Picture1 by Image1 and put an image on your form.
Nov 5 '06 #2
Killer42
8,435 Expert 8TB
hi
try something like:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Option1_Click(Index As Integer)
  2. Picture1.Picture = LoadPicture()
  3. Select Case Index
  4. Case Is = 0: Picture1.Picture = LoadPicture(App.Path & "\Picure1.bmp")
  5. ...
If you want to avoid the delay as each image is loaded, you can load your pictures into six separate Picturebox (or Image) controls once, then just make them visible or not depending on which you want to display. Assuming that these controls are to be in an array, you may find it more convenient to simply create the first one at design time, set the Index property to 0 (zero), then include code something like...
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.   Dim I As Long
  3.   For I = 1 To 5
  4.     With Picture1(0)
  5.       Load Picture1(I) ' Create the new picture box.
  6.       Picture1(I).Move .Left, .Top
  7.     End With
  8.   Next
  9. End Sub
Alternatively, you could load the pictures into the controls at design time, so they are stored permanently in your compiled program. Then just use the .Visible property to hide/show them at runtime, or the .ZOrder method to move them in front of or behind each other.

Note: Generally speaking, unless you specifically need properties/methods unique to the picturebox control, you should use the Image control. If it gives you any problems related to size, here's a hint - check out the "Stretch" property.
Nov 5 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Al Davis | last post by:
Note: I tried cross-posting this message to several newsgoups, including comp.lang.perl.misc, c.l.p.moderated, comp.infosystems.www.authoring.cgi, comp.lang.javascript and comp.lang.php. Nothing...
9
by: Michael Burtenshaw | last post by:
I would like to make a slide show using random images. The problem is my host is 250.com, and they don't support cgi-programs. Is there another way to accomplish random images?
7
by: 7mary4 | last post by:
I am working on a kiosk for a museum, we will be using firefox as the browser, with windows, and a touch screen. We'd like to create a slide show of a small portfolio when the visitors click...
8
by: marslee | last post by:
I know how to use buttons to go to the next and previous picture in slide show, but i want to change it so when the user clicks the picture instead of button, the script shows the next phicture. ...
7
by: Rudy | last post by:
Hello All! After working in the television industry, moving to a developing career has been interesting to say the least. 3 years of developing with books, and the help of you fine folks on this...
1
by: Oelie | last post by:
Hello, I'm trying to make a photo slide show in VB6. I'm trying to get the right size for my pictures, they have to fill up the screen entirely. It works with the first picture. But when a picture...
1
by: mumbaisalsa | last post by:
hi all, i want to run the slide show say ten slides and then close it , but in my code given below it opens the slide show and closes immediately ... .. please give me a solution to this...
2
by: vineetbindal | last post by:
Hi all, We have a slide show in a page which shows slids rotating after every 8-10 seconds with some descriptions about them. The problem is if the connection speed is slow then the page loads...
0
by: impin | last post by:
i have a created a blog in blogspot. i want add a photo slide show in the blog... so i created a photo slide show using flash, xml and style sheets with my own photos... is it possible to add...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.