rotsey Posted March 11, 2005 Posted March 11, 2005 Hi, I want to pass to a sub in a web page class the address of a sub in that class like this MySub(addressof MyOtherSub) But how do I write the declaration of MySub As in something like public sub MySub(sub as Somethingorother) what is the "Somethingorother" to be?????? Please help rotsey Quote
rotsey Posted March 11, 2005 Author Posted March 11, 2005 I did some research and I think it should be EventHandler is this right? Quote
Diesel Posted March 11, 2005 Posted March 11, 2005 'Create a Delegate, that has the same params as your function Delegate Sub Pixel(ByVal x As Integer, _ ByVal y As Integer) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MessageSystem(AddressOf PlotPixel) End Sub Private Sub MessageSystem(ByRef proc As Print) proc.DynamicInvoke(New Object() {1, 2}) End Sub Private Sub PlotPixel(ByVal x As Integer, ByVal y As Integer) MessageBox.Show(x.ToString()) End Sub Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.