473,411 Members | 2,014 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,411 software developers and data experts.

sliding images through two command button

3
How to write a code in vb to slide images through two command button named like previous and next.When next button will be pressed the next image will be shown in picture box.and the vice-versa for the previous button.
Oct 5 '07 #1
3 2070
QVeen72
1,445 Expert 1GB
Hi,

use LoadPicture function:

Picture1.Picture = LoadPicture ("C:\Pict1.bmp")

Keep a Counter / FileListbox, and loop through all pictures..

Regards
Veena
Oct 5 '07 #2
gourab
3
I have made a control array of the picture box and kept a counter of it and tried to loop through all the pictures..But it is not working.....Plz. help.
I have tried it like this--

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.  
  3. For i = 0 To 3
  4.  
  5.   If i = 0 Then
  6.     Picture1 [i].Picture = LoadPicture("C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Winter.jpeg")
  7.   End If
  8.   If i = 1 Then
  9.     Picture1 [i].Picture = LoadPicture("C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpeg")
  10.   End If
  11.   If i = 2 Then
  12.     Picture1 [i].Picture = LoadPicture("C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpeg")
  13.   End If
  14.   If i = 3 Then
  15.     Picture1 [i].Picture = LoadPicture("C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills.jpeg")
  16.   End If
  17. Next i
  18.  
  19. End Sub
Oct 7 '07 #3
Killer42
8,435 Expert 8TB
VB doesn't use [square brackets] for indexes in an array. It uses (parentheses).
Oct 7 '07 #4

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

Similar topics

1
by: Guadala Harry | last post by:
AFAIK, when placing an object into the Cache with no special instructions (no dependencies, sliding expirations, hard expirations, etc), it will just sit there in the Cache until the system decides...
1
by: Martin Keeton | last post by:
I.m developing applications using VB.NET and have a number of command buttons that have images on them. When The application is run with the classic windows style look the images appear just fine but...
1
by: Viktor | last post by:
Hello, I started to rewrite the lightbox code for a different layout. The main advantage would be to have a sliding image bar, but I can not get the sliding motion. The html code: <div...
0
by: Frenchie | last post by:
Hi, I have created a very neet menu from an example found on the MSDN library at: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.menuitembinding.imageurlfield.aspx My...
7
by: petr pilsl | last post by:
sorry - no idea where to post my question, so I crossposted to a linux and a html-authoring-group. Both groups might be familiar with wget. wget -p http://www.goldfisch.at does not load the...
3
by: tesa | last post by:
Thanks for the help early this morning! The one problem I can not figure out still is how to swap the images. I have the images in an array. is the image to start with.... then as the player...
2
by: Pedro | last post by:
Hi I'm trying to build a small application that can display some images in a toplevel window. I have this code: def Results(master): from Tkinter import Toplevel, Button, Label from PIL...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.