Click here to Skip to main content
16,007,779 members
Home / Discussions / C#
   

C#

 
AnswerRe: Is there some sort of limit involved? Pin
ReactiveX3-Dec-07 18:51
ReactiveX3-Dec-07 18:51 
GeneralRe: Is there some sort of limit involved? Pin
CKnig3-Dec-07 19:05
CKnig3-Dec-07 19:05 
GeneralRe: Is there some sort of limit involved? Pin
Adeel Chaudhry3-Dec-07 21:41
Adeel Chaudhry3-Dec-07 21:41 
GeneralRe: Is there some sort of limit involved? Pin
CKnig4-Dec-07 1:36
CKnig4-Dec-07 1:36 
QuestionAdding/Removing parent's keypressed handler on MDI child VisibleChange method Pin
dsovino3-Dec-07 18:40
dsovino3-Dec-07 18:40 
GeneralRe: Adding/Removing parents presskey handler on MDI child VisibleChange method Pin
CKnig3-Dec-07 18:52
CKnig3-Dec-07 18:52 
GeneralRe: Adding/Removing parents presskey handler on MDI child VisibleChange method Pin
dsovino3-Dec-07 19:02
dsovino3-Dec-07 19:02 
GeneralRe: Adding/Removing parent's keypressed handler on MDI child VisibleChange method Pin
m@u3-Dec-07 22:48
m@u3-Dec-07 22:48 
Hi.

i'm not sure if you have to do it that way, but if i have to unsubscribe eventhandlers i use to keep them as member variables in my class:

public MyForm:Form
{
    // some code here;
    private KeyPressEventHandler myHandler;
    public MyForm()
    {
        //...
        InitializeComponent();
        myHandler = new KeyPressEventHandler(Form1_KeyPressed);
        subscribe();
        //...
    }
    public void subscribe()
    {
        this.KeyPress += myHandler;
    }
    public void unsubscribe()
    {
        this.KeyPress -= myHandler;
    }
    private void Form1_KeyPressed(object sender, KeyPressEventArgs e)
    {
        // some stuff here..
    }
}

and from your MDI Child form you do simply call now the subscribe() and unsubscribe() methods.
hope this helps
m@u
GeneralRe: Adding/Removing parent's keypressed handler on MDI child VisibleChange method Pin
dsovino4-Dec-07 6:12
dsovino4-Dec-07 6:12 
GeneralChecked Lists Help Pin
chanzeb3-Dec-07 18:19
chanzeb3-Dec-07 18:19 
GeneralRe: Checked Lists Help Pin
CKnig3-Dec-07 18:39
CKnig3-Dec-07 18:39 
GeneralRe: Checked Lists Help Pin
chanzeb3-Dec-07 18:52
chanzeb3-Dec-07 18:52 
GeneralRe: Checked Lists Help Pin
CKnig3-Dec-07 18:56
CKnig3-Dec-07 18:56 
GeneralRe: Checked Lists Help Pin
chanzeb3-Dec-07 19:03
chanzeb3-Dec-07 19:03 
GeneralRe: Checked Lists Help Pin
chanzeb3-Dec-07 19:04
chanzeb3-Dec-07 19:04 
QuestionHow to convert byte[] to string Pin
dungpapai3-Dec-07 17:31
dungpapai3-Dec-07 17:31 
GeneralRe: How to convert byte[] to string Pin
Vikram A Punathambekar3-Dec-07 17:37
Vikram A Punathambekar3-Dec-07 17:37 
QuestionHow to catch the text between two boundaries? Pin
Khoramdin3-Dec-07 17:03
Khoramdin3-Dec-07 17:03 
AnswerRe: How to catch the text between two boundaries? Pin
mav.northwind4-Dec-07 10:45
mav.northwind4-Dec-07 10:45 
QuestionBitmap reference somehow set to null - unwanted garbage collection? Pin
cdm5z3-Dec-07 15:32
cdm5z3-Dec-07 15:32 
GeneralRe: Bitmap reference somehow set to null - unwanted garbage collection? Pin
CKnig3-Dec-07 18:47
CKnig3-Dec-07 18:47 
GeneralCan't write to multi-dimension DataSet Pin
MAW303-Dec-07 15:21
MAW303-Dec-07 15:21 
AnswerRe: Can't write to multi-dimension DataSet Pin
Vikram A Punathambekar3-Dec-07 17:35
Vikram A Punathambekar3-Dec-07 17:35 
GeneralRe: Can't write to multi-dimension DataSet Pin
MAW303-Dec-07 18:21
MAW303-Dec-07 18:21 
GeneralRe: Can't write to multi-dimension DataSet Pin
CKnig3-Dec-07 18:32
CKnig3-Dec-07 18:32 

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.