Calling Subprocedure

GamesRule
01-14-2004, 08:21 AM
Hi

I need to call the listbox_doubleclick event.

I have
lstCurrentPlaylist_DoubleClick()

Says "Argument Not Specified for parameter "e" of Private Sub lstCurrentPlaylist_DoubleClick(sender as object, e as system.eventargs)


In the lstCurrentPlaylist_DoubleClick I have:


Private Sub lstCurrentPlaylist_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstCurrentPlaylist.DoubleClick
Media1.URL = lstCurrentPlaylist.SelectedItem
End Sub


Do I have to do something with the ByVal e As System.EventArgs in the parantheses of the call line?

VBJoe
01-14-2004, 09:34 AM
Create another Sub, and call it from the Event Procedure. Then, when you need that functionality, you call the Sub you created rather than the Event Procedure:

Private Sub lstCurrentPlaylist_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstCurrentPlaylist.DoubleClick
SomeSub
End Sub

Private Sub SomeSub()
Media1.URL = lstCurrentPlaylist.SelectedItem
End Sub

Private Sub SomeOtherSub()
SomeSub
End Sub

Csharp
01-14-2004, 10:31 AM
lstCurrentPlaylist_DoubleClick(sender , e )
'/// or lstCurrentPlaylist_DoubleClick(Me , e )

:)

GamesRule
01-14-2004, 10:39 AM
lstCurrentPlaylist_DoubleClick(sender , e )
'/// or lstCurrentPlaylist_DoubleClick(Me , e )

:)

I used
lstCurrentPlaylist_DoubleClick(sender , e )

However, the "e" is underlined and says "Value of type AxWmpLib._WMPOCXEvents_PlayStateChangeEvent Cannot be converted To System.EventArgs"

Thanks for the reply. What do you think the problem with this is?
I have included a zip file if it helps

Optikal
01-14-2004, 12:16 PM
Use the way VBJoe suggested, it is the cleanest way of doing these things. My own personal rule is that I never call an event procedure explicitly from code.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum