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

Form Shake

I have a splash screen that boots with music in the background. I want
the splash screen to look like it is shaking, or is being shaked. What
is the best way to do this?

Feb 17 '06 #1
2 5201
Hi put a button on a form

and then paste this code, I hope this is enough shaking for you, probably
there are some nicer solutions but this should give you an idea

Hope this helps

Greetz Peter
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
shakeMe()
End Sub

Private Sub shakeMe()
Dim myLoc As Point, myLocDef As Point
myLocDef = Me.Location
myLoc = Me.Location
For i As Integer = 0 To 100
For x As Integer = 0 To 4
Select Case x
Case 0
myLoc.X = myLocDef.X + 10
Case 1
myLoc.X = myLocDef.X - 10
Case 2
myLoc.Y = myLocDef.Y - 10
Case 3
myLoc.Y = myLocDef.Y + 10
Case 4
myLoc = myLocDef
End Select
Me.Location = myLoc
Me.Refresh()
Next
Next
Me.Location = myLocDef
Me.Refresh()
End Sub

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"pmclinn" <pm*****@gmail.com> schreef in bericht
news:11**********************@g14g2000cwa.googlegr oups.com...
I have a splash screen that boots with music in the background. I want
the splash screen to look like it is shaking, or is being shaked. What
is the best way to do this?

Feb 17 '06 #2
"pmclinn" <pm*****@gmail.com> schrieb:
I have a splash screen that boots with music in the background. I want
the splash screen to look like it is shaking, or is being shaked. What
is the best way to do this?


Place a timer on the form and move the form within its 'Tick' event handler
('Form.{Location, Left, Top}').

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Feb 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: shake | last post by:
I have to develop an application sounds like this:- User is allow to access a form (is actually a test/quiz) within a specific time frame, let say 45 minutes. After this 45 minutes, if the user...
3
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change...
9
by: Eunice Santorini | last post by:
Every once in a while (especially when I visit suspect web sites :), every single window on my Microsoft Windows XP & Microsoft Windows 2000 operating systems goes haywire. All the windows...
5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
5
by: Ben | last post by:
Hi, I'm having trouble with the CSS apparently not working fully on the form input fields when inside an iFRAME. The problem is that if I resize the text size on the test.html page(see below)...
4
by: ry66 | last post by:
Hello All! Is it possible to submit a form using hyperlink? I want to send hidden element when a link is clicked. I read some books, but I found only using button which I don't want to use. ...
4
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the...
27
by: Scott | last post by:
I've been trying to come up with a way to ensure user input is coming from the form on my site, and not auto-submitted from elsewhere, and I don't want to use the "enter the code shown in the...
2
by: ML | last post by:
Very strange phenomenon. Form with tabbed pages. I think that when I move the mouse (wheeled), over an unconnected label - as opposed to one linked to a textbox, the page contents "shake". I...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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,...

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.