nightkhaos Posted January 25, 2011 Report Posted January 25, 2011 am o librarie in C# si am un event OnReceivedData,libraria asta o includ in main program, cum fac sa adaug un delegate la functia OnReceivedData astfel incat cand se declanseaza OnReiceivedData eu sa chem o functie din MainProgram? Quote
phreak Posted January 25, 2011 Report Posted January 25, 2011 Delegates and Events in C# / .NETdeci class.OnReceivedData += new OnReceivedDataHandler ( MyFunction );unde inlocuiesti OnReceivedDataHandler cu delegatul asociat eventului si MyFunction cu o functie care are aceeasi parametrii si return type precum delegatul. Quote
nightkhaos Posted January 25, 2011 Author Report Posted January 25, 2011 Am rezolvat am facut un delegate in libraria mea iar lui i-am adaugat o metoda din main program,apoi delegateul l-am chemat in eventul meu. Quote
roberta11 Posted February 3, 2011 Report Posted February 3, 2011 Buna!Spuneti-mi va rog cum as putea sa fac in C#....am o baza de date in Access cu cateva tabele,iar in C# sa fac pe un Form adaugare,stergere si modificare,iar acele 3 butoane sa le activez. Quote