473,378 Members | 1,280 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,378 software developers and data experts.

Visual basic To make a random image

4
Is there any one who can help me to make a game .This game have to create with visual basic 2005 and it is like there are three images and one by one is appeared and disappeared. Our objective is to try to click fast these images as much as we can. Moreover if we click one image we will get score. this game have to start when we click Start button and stop by pressing stop button


Plz somebody help me i don't know how to make the image to go around the
box appear and disappear.....
Jan 10 '08 #1
6 9816
Ali Rizwan
925 512MB
Is there any one who can help me to make a game .This game have to create with visual basic 2005 and it is like there are three images and one by one is appeared and disappeared. Our objective is to try to click fast these images as much as we can. Moreover if we click one image we will get score. this game have to start when we click Start button and stop by pressing stop button


Plz somebody help me i don't know how to make the image to go around the group
box appear and disappear.....
This is the code for generating random nos.

Expand|Select|Wrap|Line Numbers
  1. Randomize
  2.     Label1.caption= Int((6 - 1 + 1) * Rnd + 1)
  3.  
This code will generate random nos between 1-6 if you replace 6 with 3 numbers are generated between 1-3.
Now assign a number to every pic like pic is to 1, pic2 is to 2 and so on.
Now write this code in label1 Change event.

Expand|Select|Wrap|Line Numbers
  1. Select case label1.caption
  2.  
  3. case 1
  4. pic.picture=loadimage(Path of image)
  5.  
  6. case 2
  7. pic.picture=loadimage(Path of image)
  8.  
  9. case 3
  10. pic.picture=loadimage(Path of image)
  11.  
  12. end select
Now pics you need to show are randomly appeared.

Regards
>> ALI <<
Jan 10 '08 #2
wisten
4
can u show me ur form bcoz i don't get it well??
should i declare label1_caption as random or integer?
what should i put inside "pic.picture" ?
Jan 10 '08 #3
Ali Rizwan
925 512MB
I ll make a demo for you.
OK
For further helps you can contact me by mails or by Yahoo! messenger.
You ll find my address from my profile (by clicking on my name or avatar).

REGARDS
>> ALI <<
Jan 10 '08 #4
wisten
4
okay and thanks a lot
Jan 10 '08 #5
You can use the following:

I use it to rotate 6 different pictures in a program I am writeing.

Place a timer called "RotatePic" set to time to rotate pictures.
Load one of the pictures in a picture box called "picRotate"
Load the other pictures in image boxs indexed 0 thru 7

Public Sub RotatePic_Timer()

Static thispic As Integer

If thispic = 7 Then thispic = -1
thispic = thispic + 1

If (picRotate.Left) > ScaleWidth Then picRotate.Left = -100
picRotate.Picture = imgChrist(thispic).Picture

End Sub
Jan 29 '08 #6
Ali Rizwan
925 512MB
can u show me ur form bcoz i don't get it well??
should i declare label1_caption as random or integer?
what should i put inside "pic.picture" ?
label1 is the label control and in pic is the picture control names.
load some pic in picture box.

Regards
>> ALI <<
Jan 30 '08 #7

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

Similar topics

6
by: Richard | last post by:
I'm looking to do my own basic encryption. I've been tyring to do a concept such as: I pass this function the string, key and number of rounds I want to do the encryption. because im round...
12
by: Skybuck Flying | last post by:
Hello, I have a little piece of C source code which was probably made on a UNIX system. I would like to try and compile/build this source code on/for Windows XP with Visual C/C++ 6.0. The...
4
by: LCAdeveloper | last post by:
I have had to move to Visual Studio.NET Pro. from Visual Basic 4.0 and am now starting to re-write our code. I was a bit surprised to find that Visual Basic.NET no longer supports fixed length...
2
by: frossberg | last post by:
Hello! I tried to install the Visual Basic.NET Resource Kit (http://msdn.microsoft.com/vbasic/vbrkit/) but obviously something went very wrong and now it sems impossible both to repair and to...
6
by: Tom McL. | last post by:
I'm trying to move a program that was designed using Visual Studio 2003 and (Visual Basic) into Visual Studio 2005. When it runs I get the following warning in the Error List Window and I'm not...
0
by: Athono | last post by:
I am new to Visual Basic. So the differences between C++ and VB are striking to me. But even this seems like too much. Here is what I am talking about: I got a project out of source safe and I...
6
by: comp.lang.php | last post by:
/** * Generate the random security image * * @access public * @param $willUseFilePath (default false) boolean to determine if you will be using a file path * @param mixed $filePath (optional)...
4
by: Kim | last post by:
Random image downloader for specified newsgroup. Hi I'm writing a small script that will download random images from a specified newsgroup. I've imported yenc into the script but I can't open the...
11
by: =?Utf-8?B?UGV0ZXIgSw==?= | last post by:
I am working with Visual Studio or alternately with Expression Web. I need to create about 50 aspx pages with about 1200 thumbnali images, typically arranged in three to four groups per page,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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

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.