Simple Question VB. Net

  • Thread starter Thread starter HardySpicer
  • Start date Start date
H

HardySpicer

I have the following call from a Button1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strMp3 As String

strMp3 = "chop2.mp3"

Me.AxWindowsMediaPlayer1.URL = strMp3
End Sub
This works fine as part of a larger program and the file plays.

However, if I want to automatically push the button in the code how do
I do this?

I trie

Button1_click ()

but it compains tyhat a declaration is expected? How do I do this...

regards

Hardy
 
HardySpicer said:
I have the following call from a Button1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strMp3 As String

strMp3 = "chop2.mp3"

Me.AxWindowsMediaPlayer1.URL = strMp3
End Sub
This works fine as part of a larger program and the file plays.

However, if I want to automatically push the button in the code how do
I do this?

I trie

Button1_click ()

but it compains tyhat a declaration is expected? How do I do this...

regards

Hardy


Try the Button class PerformClick() method, documented here:

http://msdn2.microsoft.com/en-us/library/system.windows.forms.button.performclick.aspx
 
Back
Top