Click here to Skip to main content
15,922,145 members
Home / Discussions / C#
   

C#

 
QuestionHow can i access event of other class Pin
Naveed72727-Apr-08 21:05
Naveed72727-Apr-08 21:05 
AnswerRe: How can i access event of other class Pin
Christian Graus27-Apr-08 21:10
protectorChristian Graus27-Apr-08 21:10 
GeneralRe: How can i access event of other class Pin
Naveed72727-Apr-08 21:18
Naveed72727-Apr-08 21:18 
AnswerRe: How can i access event of other class Pin
Razvan Dimescu27-Apr-08 22:06
Razvan Dimescu27-Apr-08 22:06 
GeneralRe: How can i access event of other class Pin
J4amieC27-Apr-08 22:16
J4amieC27-Apr-08 22:16 
GeneralRe: How can i access event of other class [modified] Pin
Razvan Dimescu27-Apr-08 22:23
Razvan Dimescu27-Apr-08 22:23 
GeneralRe: How can i access event of other class Pin
Naveed72729-Apr-08 20:56
Naveed72729-Apr-08 20:56 
GeneralRe: How can i access event of other class Pin
Naveed72730-Apr-08 21:56
Naveed72730-Apr-08 21:56 
Your technique is ok when i am using function in Parenct class but if i am useing event in Parent then it fail.

i write the code which belew

<br />
<br />
public class Parent : TreeView<br />
    {<br />
        public delegate void MyDelegate(string str);<br />
        public static event MyDelegate MYEvent;<br />
<br />
         protected override void OnBeforeExpand(TreeViewCancelEventArgse)<br />
        {<br />
            //trigger the event here<br />
            if (MYEvent != null)  //HOw can we assign value to MYEvent becouse it is allways empty<br />
            {<br />
                Parent.MYEvent("hello listeners"); //Null refrence exception occure<br />
            }<br />
        }<br />
    }<br />
<br />
<br />
    public class MainClass<br />
    {<br />
        public MainClass()<br />
        {<br />
            //subscribe to the event from Parent Class<br />
            Parent.MYEvent += new Parent.MyDelegate(Parent_MYEvent);<br />
        }<br />
<br />
        // called when event is triggered<br />
        public void Parent_MYEvent(string str)<br />
        { <br />
        	MessageBox(str);<br />
        }<br />
    }<br />
<br />

GeneralRe: How can i access event of other class Pin
Razvan Dimescu1-May-08 7:21
Razvan Dimescu1-May-08 7:21 
GeneralCapture Http POST data from IE Pin
kafeel27-Apr-08 20:51
kafeel27-Apr-08 20:51 
GeneralTemporary DLL files Pin
Ahmet GULBAY27-Apr-08 20:47
Ahmet GULBAY27-Apr-08 20:47 
GeneralRe: Temporary DLL files Pin
Christian Graus27-Apr-08 21:00
protectorChristian Graus27-Apr-08 21:00 
GeneralRe: Temporary DLL files Pin
Ahmet GULBAY27-Apr-08 21:16
Ahmet GULBAY27-Apr-08 21:16 
GeneralThreadPool Pin
George_George27-Apr-08 19:40
George_George27-Apr-08 19:40 
GeneralRe: ThreadPool Pin
Zoltan Balazs27-Apr-08 21:48
Zoltan Balazs27-Apr-08 21:48 
GeneralRe: ThreadPool Pin
George_George27-Apr-08 23:30
George_George27-Apr-08 23:30 
GeneralRe: ThreadPool Pin
Zoltan Balazs28-Apr-08 1:29
Zoltan Balazs28-Apr-08 1:29 
GeneralRe: ThreadPool Pin
George_George28-Apr-08 1:43
George_George28-Apr-08 1:43 
GeneralRe: ThreadPool Pin
Zoltan Balazs28-Apr-08 2:49
Zoltan Balazs28-Apr-08 2:49 
GeneralRe: ThreadPool Pin
George_George28-Apr-08 3:50
George_George28-Apr-08 3:50 
GeneralRe: ThreadPool Pin
Zoltan Balazs28-Apr-08 4:29
Zoltan Balazs28-Apr-08 4:29 
GeneralRe: ThreadPool Pin
George_George28-Apr-08 4:51
George_George28-Apr-08 4:51 
GeneralRe: ThreadPool Pin
Zoltan Balazs28-Apr-08 4:58
Zoltan Balazs28-Apr-08 4:58 
GeneralRe: ThreadPool Pin
George_George29-Apr-08 1:31
George_George29-Apr-08 1:31 
GeneralRe: ThreadPool Pin
Zoltan Balazs29-Apr-08 1:47
Zoltan Balazs29-Apr-08 1:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.