Important alert: (current site time 7/16/2013 1:23:47 AM EDT)
 

VB icon

[ Crazy Form ]

Email
Submitted on: 9/13/2003 6:59:01 PM
By: JamesJD  
Level: Beginner
User Rating: By 20 Users
Compatibility: VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 46800
author picture
(About the author)
 
     This code makes the form jump around the screen and changes it's size. Please vote and comment :)
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
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.
				
'**************************************
' Name: [ Crazy Form ]
' Description:This code makes the form jump around the screen and changes it's size. Please vote and comment :)
' By: JamesJD
'
' Inputs:One Timer called, Timer1, with an interval of about 100.
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=48472&lngWId=1'for details.'**************************************

Private Sub Timer1_Timer()
Dim Height As String
Dim Width As String
Dim Top As String
Dim Left As String
Randomize
Height = Int(Rnd * 10000)
Width = Int(Rnd * 10000)
Top = Int(Rnd * Screen.Height)
Left = Int(Rnd * Screen.Width)
Form1.Height = Height
Form1.Width = Width
Form1.Top = Top
Form1.Left = Left
End Sub


Other 21 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 Beginner 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
9/14/2003 1:58:45 PM

lol very amusing, tho could get annoying over time... and you would have to close it with Task Manager because it would be difficult to land a click on the moving X button.
(If this comment was disrespectful, please report it.)

 
1/13/2004 12:35:37 AM

I like it! ;) LOL
(If this comment was disrespectful, please report it.)

 
1/25/2004 10:14:46 AM

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

 
2/13/2004 4:59:32 AM

excellent little simple prog
(If this comment was disrespectful, please report it.)

 
5/15/2004 11:18:31 AM

methinks not only is the form cr@zy
(If this comment was disrespectful, please report it.)

 
6/16/2004 9:15:19 PM

lol thats pretty cool, funny to watch. hint to all ctr + break ;)
(If this comment was disrespectful, please report it.)

 
9/25/2004 8:44:26 PM

To exit:
Just add a command button on the form, resize it to make it small, and make it the cancel key....
(If this comment was disrespectful, please report it.)

 
11/19/2004 10:13:57 PM

nice program but very little hard work

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

 
3/20/2005 3:11:27 AM

Can some one please help me! Im a noob when it comes to VB and i would like to know how i can take this code and make it into a program!
(If this comment was disrespectful, please report it.)

 
3/26/2005 2:09:49 PM

huh it doesnt work here...
(If this comment was disrespectful, please report it.)

 
4/15/2005 3:41:46 AM

wow .. i thought that my unit was curropt again and i thought also that it was a virus from ah net .. very awesome prog..lolz...like it
(If this comment was disrespectful, please report it.)

 
5/8/2005 8:35:21 AM

To close the form using Escape-key at this code at the bottom of the codewindow

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
Unload Me
End
End If
End Sub

Private Sub Form_Load()
KeyPreview = True
End Sub
(If this comment was disrespectful, please report it.)

 
5/8/2005 8:35:47 AM

Sorry! ADD not AT! :D
(If this comment was disrespectful, please report it.)

 
8/2/2005 7:01:40 AMMicah

Hey, thats cool as....nice stuff even though its small its still amusing!

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

 
10/22/2005 10:00:53 PMknight

i don t get it it didn t worked 4 me i ve made a timer in there and pasted that code der but didn t worked n e opinions ?
(If this comment was disrespectful, please report it.)

 
12/6/2005 5:36:05 PM

dude this is an awesome program i never would have thought of it
(If this comment was disrespectful, please report it.)

 
3/22/2006 4:56:57 PM

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

 
8/2/2006 10:59:31 PMmark

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

 
9/4/2006 5:20:30 PMTyler Tesch

have to make timer have an interval of 100
(If this comment was disrespectful, please report it.)

 
11/18/2006 10:06:15 AMdude

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

 
1/13/2007 9:23:31 PMjay

Your'e such a nice programmer. thanks a lot for your code. I just make my own e-mail in this site because I want to develop my talent in visual basic. If you dont mind would I like to you friend.
(If this comment was disrespectful, please report it.)

 
3/16/2007 10:48:33 AMBob Harmilton

whenever i use the program my form just goes away...??? i'm not sure what to do

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

 
2/21/2008 1:12:25 AM

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

 
6/30/2008 5:56:17 PMcameron12

'also cool
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim Height As String
Dim Width As String

Randomize()
Height = Int(Rnd() * 100)
Width = Int(Rnd() * 104)
Height = Int(Rnd() * 1000000000)
Width = Int(Rnd() * 1040)


Me.Height = Height


Me.Width = Width



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

 
7/11/2008 6:24:13 PMcameron23

' this is AWSOME
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Do
Dim Height As String
Dim Width As String

Randomize()
Height = Int(Rnd() * 100)
Width = Int(Rnd() * 104)
Height = Int(Rnd() * 1000000000)
Width = Int(Rnd() * 1040)


Me.Height = Height


Me.Width = Width
Loop
End Sub

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

 
9/26/2008 5:51:22 AMMchizi_Mugoroki

I like....very wow_ing!
(If this comment was disrespectful, please report it.)

 
3/21/2009 5:28:52 AMMustafa

Thanks For Sharing this code ;)
(If this comment was disrespectful, please report it.)

 
5/6/2009 4:59:52 AM

wow.. this is fun my mate thought my comp was infected by virus when i left the program running...
very funny...
nice one..
thanks for sharing..

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

 
9/8/2009 8:14:24 AMDUDE

COOOL!
(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.