')' trying to pass a delegate error  
Author Message
Tryin2Bgood





PostPosted: Visual C# Language, ')' trying to pass a delegate error Top

I have an error but it only appears when i am trying to pass my reference to my delegate and i do not know why....Any help with this bug

Error 9 Invalid expression term ')' 


public delegate void VendorDetailsClosing(object sender, FormClosingEventArgs e);
public VendorDetailsClosing OnVendorDetailsClosing;

Tracking.UI.MainWindows.VendorOrderLegDetailsForm.DisplayVendorDetails(this.FindForm(), (BHFreight.Tracking.BusinessObjects.VendorOrderLegDetail)_OrderLegDetail, VendorDetailsClosing _DetailsClosing);


 




Visual C#7  
 
 
boban.s





PostPosted: Visual C# Language, ')' trying to pass a delegate error Top

I don't know what this code is doing but for start, remove VendorDetailsClosing from last line, because you don't have to put the type of _DetailsClosing.

 
 
ahmedilyas





PostPosted: Visual C# Language, ')' trying to pass a delegate error Top

you are trying to run a method outside the class (technically on the global scope) - this wont work. you are declaring your delegate and event globally, so the next line (last line) should be placed on a button click or some other method