473,466 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 5205
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...
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.