12 Replies - 2070 Views - Last Post: 13 June 2008 - 11:01 AM Rate Topic: -----

#1 narmer93  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 317
  • Joined: 13-March 08

HI how can i make a buzz as yahoo

Posted 12 June 2008 - 07:29 AM

hi i can make a timer to do what i want after a time
as in

Public Class Form1
    Dim a As Integer
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Timer1.Interval = 1000
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        a += 1
        If a = Me.TextBox1.Text Then
            'action'
        End If
    End Sub
End Class


how can i make a buzz as a sort of alarm so it will work after some time and alarm me
i have no idea about this buzz but can anybody help me with it

Is This A Good Question/Topic? 0
  • +

Replies To: HI how can i make a buzz as yahoo

#2 djkitt  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 189
  • Joined: 22-May 08

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 09:02 AM

View Postnarmer93, on 12 Jun, 2008 - 09:29 AM, said:

how can i make a buzz as a sort of alarm so it will work after some time and alarm me


	Sub Buzz()
								'This assumes c:\windows\media\chord.wav exists... 
		My.Computer.Audio.Play("c:\windows\media\chord.wav")
	End Sub



This will play the windows 'Chord' wav file. You could add a "Buzz" wav file to your project and play that I suppose...

Hope this helps,

This post has been edited by djkitt: 12 June 2008 - 09:05 AM

Was This Post Helpful? 0
  • +
  • -

#3 narmer93  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 317
  • Joined: 13-March 08

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 09:48 AM

hmm this plays the sound
i was asking also about that vibration
is it possible

so my code now is
vbview plainprint?
Public Class Form1  
    Dim a As Integer  
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load  
        Me.Timer1.Interval = 1000  
    End Sub  
  
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click  
        Timer1.Start()  
    End Sub  
  
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick  
        a += 1  
        If a = Me.TextBox1.Text Then  
           My.Computer.Audio.Play("c:\windows\media\chord.wav")        End If  
    End Sub  
End Class  


but how can i make this vibration?
Was This Post Helpful? 0
  • +
  • -

#4 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 10:33 AM

Vibration?!? What do you mean by vibration?

Are you referring to using the internal PC speaker vs. the external speakers attached to your computer?
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 10:43 AM

Ive never heard of making a computer vibrate, or "buzz" as you put it, and Ive been doing this a really long time.
Was This Post Helpful? 0
  • +
  • -

#6 narmer93  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 317
  • Joined: 13-March 08

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 11:39 AM

no not the computer only the form as in yahoo messenger
now i know how to add the sound noow how can i make the form vibrate with the sound
Was This Post Helpful? 0
  • +
  • -

#7 djkitt  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 189
  • Joined: 22-May 08

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 12:00 PM

You want to make a form appear to bounce around?

I suppose you could just change the Forms position a number of times, kind of a back and forth sort of thing. I have never used Yahoo Messenger so I'm not sure what it looks like.

Good Luck.
Was This Post Helpful? 0
  • +
  • -

#8 narmer93  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 317
  • Joined: 13-March 08

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 12:04 PM

and how do i do this
the ame thing is in msn but it is not called buzz i think it called a nudge
Was This Post Helpful? 0
  • +
  • -

#9 djkitt  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 189
  • Joined: 22-May 08

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 01:20 PM

View Postnarmer93, on 12 Jun, 2008 - 02:04 PM, said:

and how do i do this


OK,

You could do this using a timer set to an interval of 100 and nudge the top and left fields of the form by 10 pixels or so.

Shouldn't be too hard,
Was This Post Helpful? 0
  • +
  • -

#10 narmer93  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 317
  • Joined: 13-March 08

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 02:06 PM

ok but how can i move the form ?
Was This Post Helpful? 0
  • +
  • -

#11 djkitt  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 189
  • Joined: 22-May 08

Re: HI how can i make a buzz as yahoo

Posted 12 June 2008 - 02:20 PM

View Postnarmer93, on 12 Jun, 2008 - 04:06 PM, said:

ok but how can i move the form ?



Alternating between these two (every other tick) in a timer with an interval of 100 milliseconds should make the form appear to vibrate.


'INSIDE TIMER_TICK:

'This will move the form up 10 pixels and left 10 pixels
Me.Top = Me.Top + 10
Me.Left = Me.Left - 10

'This will move it back
Me.Top = Me.Top - 10
Me.Left = Me.Left + 10


This post has been edited by djkitt: 12 June 2008 - 02:23 PM

Was This Post Helpful? 0
  • +
  • -

#12 narmer93  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 317
  • Joined: 13-March 08

Re: HI how can i make a buzz as yahoo

Posted 13 June 2008 - 08:32 AM

so the code will be


Public Class Form1  
    Dim a As Integer  
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load  
        Me.Timer1.Interval = 100
    End Sub  
  
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click  
        Timer1.Start()  
    End Sub  
  
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick  
        a += 1  
        If a = Me.TextBox1.Text Then  
          Me.Top = Me.Top + 10
          Me.Left = Me.Left - 10


                Me.Top = Me.Top - 10
           Me.Left = Me.Left + 10


        End If  
    End Sub  
End Class  


Was This Post Helpful? 0
  • +
  • -

#13 djkitt  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 189
  • Joined: 22-May 08

Re: HI how can i make a buzz as yahoo

Posted 13 June 2008 - 11:01 AM

View Postnarmer93, on 13 Jun, 2008 - 10:32 AM, said:

so the code will be ...


Not exactly...

Here is the general idea

In each timer_tick call you *either* move the top up *or* move the top down. If you move both ways it will be too quick to see and it will appear that the form did not move at all. That is why you need to use the timer, to introduce a delay...

You also want the timer to execute the nudging until a count is reached, not just once when the count is reached (which is what would happen in your code right now.)


Public Class Form1	

	Dim a As Integer 
   
	Dim toggle As Integer = 1 

	Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		Me.Timer1.Interval = 100
		Me.Timer1.Enabled = False
	End Sub

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		a = 0
		Timer1.Enabled = True
	End Sub

	Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
		Timer1.Enabled = False  'pause the timer while we are working
		toggle = toggle * -1 ' This will change whether 10 is added or subtracted to Top and Left
		a += 1
		Me.Top = Me.Top + 10 * toggle
		Me.Left = Me.Left - 10 * toggle
		If a <= Me.TextBox1.Text Then
			Timer1.Enabled = True 'only restart the timer if it should still be vibrating
		End If
	End Sub
  
End Class	



Was This Post Helpful? 0
  • +
  • -

Page 1 of 1