Simple Question VB. Net

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
 
P

PvdG42

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top