[ScintillaNET] Focus Bug Fix

  • From: Greg Dietsche <greg@xxxxxxxxx>
  • To: ScintillaNET <ScintillaNET@xxxxxxxxxxxxx>
  • Date: Fri, 25 Jun 2004 13:33:36 -0500

Hi guys,
I fixed the problems where the ScNET control didn't focus properly.

Add this to WinApi.cs:
        [DllImport("user32.dll")]
        public  static extern int  SetFocus(IntPtr  hwnd);

Add this to ScintillaControl.cs:

        protected override void OnGotFocus(System.EventArgs e)
        {
            WinAPI.SetFocus(hwndScintilla);
            IsFocus=true;
        }

        protected override void OnLostFocus(System.EventArgs e)
        {
            IsFocus=false;   
        }

        public new bool Focus()
        {
            OnGotFocus(new EventArgs());
            return IsFocus;
        }

        public override bool Focused
        {
            get
            {
                return IsFocus;
            }
        }

--

Regards,
Greg Dietsche     http://www.gregd.org/
GForce Programming:   http://calc.gregd.org
Detached Solutions:      http://www.detachedsolutions.com

-------------------------------------------------------------------------- ScintillaNET Mailing List: ScintillaNET@xxxxxxxxxxxxx To unsubscribe: Send an email to scintillanet-request@xxxxxxxxxxxxx and put "unsubscribe" (without the quotes) in the Subject line. Web Page: http://tinyurl.com/yvoh2

Other related posts:

  • » [ScintillaNET] Focus Bug Fix