IGlobal..::.EnableAccelerators Method

 
 
 
Posted by:SITT
Data created:26 May 2010

why? execute this methods in timer,my winform cannot input key

void InitializeKeyEnabledTimer()
        {
            KeyEnabledTimer = new System.Timers.Timer(200);
            KeyEnabledTimer.Elapsed += new System.Timers.ElapsedEventHandler(KeyEnabledTimer_Elapsed);
            KeyEnabledTimer.Enabled = true;
            Activated += new EventHandler(BaseForm_Activated);
            Deactivate += new EventHandler(BaseForm_Deactivate);
        }
        void KeyEnabledTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            MaxGlobal.EnableAccelerators();
            this.Text += " ##";
        }
        void BaseForm_Activated(object sender, EventArgs e)
        {
            KeyEnabledTimer.Enabled = true;
        }
        void BaseForm_Deactivate(object sender, EventArgs e)
        {
            KeyEnabledTimer.Enabled = false;
        }

form's title cant += "##"

but cant input key to txt box

Why are you using a timer? Not sure what you are trying to do but have you looked at this?

Marsel Khadiyev (Software Developer, EPHERE Inc.)

thankyou