Important alert: (current site time 7/16/2013 12:43:39 AM EDT)
 

winzip icon

[[[ Everytime you click on form, a picture is added, unlimited! ]]]

Email
Submitted on: 8/3/2002 1:37:31 PM
By: Melvin T. 
Level: Intermediate
User Rating: By 6 Users
Compatibility: VB 5.0, VB 6.0
Views: 33180
(About the author)
 
     This is a more clear version of the previous post i have posted. This Code adds an image (ball) every time you click on the form, unlimited. So actually your app adds a control by itself. I know many people where looking for this code, so here it is. You can use every control, eg command buttons, textboxes, timers etc. Greets, Melvin

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
8/3/2002 3:39:24 PMEnem

I think that more work is needed that the balls respect the form's size limite.
(If this comment was disrespectful, please report it.)

 
8/3/2002 7:49:05 PMMelvin

???
It's just a demo to show how to add controls while the app is running. Why does it make sense when you make the balls got respect for the form size??
(If this comment was disrespectful, please report it.)

 
11/12/2002 9:06:59 PM

Melvin,

Your codes is simple yet help many programmers. Thanks for ur sharing.

However, i do have an issue related to your codes. In ur program, when a user click on the form, u load a new object (array of image) and display it.

Now, having doing the above, i want to remove the image by clicking the image. HOw can i perform this? tried to use the unload function but couln't work. Please help if u know.



(If this comment was disrespectful, please report it.)

 
1/21/2003 4:27:41 AM

Ciao Melvin!

Is there a way to do the same thing in access with vba? i always get an error...
greetz
sandro
(If this comment was disrespectful, please report it.)

 
5/24/2003 1:20:12 PM

Thanks been trying to figure out how to do this!
(If this comment was disrespectful, please report it.)

 
7/6/2003 1:35:30 AM

hai!
(If this comment was disrespectful, please report it.)

 
8/28/2003 5:55:26 PMJamesJD

Love the code, thanks alot :)
(If this comment was disrespectful, please report it.)

 
4/11/2004 2:14:49 PMLCSBSSRHXXX

thats handy, i used something simalar for a shooter game i made a long time ago:

dim random as integer
dim b

b=b+1
load bullet(b)
bullet(b).visable = true
random = int(rnd * 4)
select case random
case 0
bullet(b).left = x + (rnd * 1000)
case 1
bullet(b).top = y + (rnd * 1000)
case 2
bullet(b).left = x - (rnd * 1000)
case 3
bullet(b).top = y - (rnd * 1000)
end select
(If this comment was disrespectful, please report it.)

 
12/10/2004 6:24:02 AM

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

Select Case Button

Case 1

Load Image1(Image1.Count)

Image1(Image1.Count - 1).Visible = True
Image1(Image1.Count - 1).Top = Image1(Image1.Count - 2).Top
Image1(Image1.Count - 1).Left = Image1(Image1.Count - 2).Left + 495

Case 2

Unload Image1(Image1.Count - 1)

End Select

End Sub

(If this comment was disrespectful, please report it.)

 
12/7/2005 11:57:26 AMOjulari Abdulkabir

yeah!but if u can set an object on motion as demo,please anyone who knows should explain both the controls,properties and source codes
(If this comment was disrespectful, please report it.)

 
1/2/2007 2:05:01 AMasif

Asif sourse
(If this comment was disrespectful, please report it.)

 
9/19/2011 11:40:43 AM

good code
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.