PC Review


Reply
Thread Tools Rate Thread

OnGotFocus Problem

 
 
Mubashir Khan
Guest
Posts: n/a
 
      6th Sep 2005
I am deriving a class from TextBox to implement a NumericBox. I am
overriding OnGotFocus and OnLostFocus methods but On GotFocus is causing
problems. Actually the commented lines are causing problems. These throw
Win32 exception that windows was unable to create handle. I dunno wats
wrong. Plz help

protected override void OnGotFocus(EventArgs e)
{
//this.TextAlign=HorizontalAlignment.Left;
//this.SelectionStart=base.Text.Length;
base.OnGotFocus(e);
}

protected override void OnLostFocus(EventArgs e)
{
this.TextAlign=HorizontalAlignment.Right;
base.OnLostFocus(e);
}


 
Reply With Quote
 
 
 
 
Mubashir Khan
Guest
Posts: n/a
 
      6th Sep 2005
I have used OnEnter and OnLeave too. It works fine but TextAlign property is
causing problem. Any Clues ???

"Mubashir Khan" <(E-Mail Removed)> wrote in message
news:ewaW3$(E-Mail Removed)...
> I am deriving a class from TextBox to implement a NumericBox. I am
> overriding OnGotFocus and OnLostFocus methods but On GotFocus is causing
> problems. Actually the commented lines are causing problems. These throw
> Win32 exception that windows was unable to create handle. I dunno wats
> wrong. Plz help
>
> protected override void OnGotFocus(EventArgs e)
> {
> //this.TextAlign=HorizontalAlignment.Left;
> //this.SelectionStart=base.Text.Length;
> base.OnGotFocus(e);
> }
>
> protected override void OnLostFocus(EventArgs e)
> {
> this.TextAlign=HorizontalAlignment.Right;
> base.OnLostFocus(e);
> }
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnGotFocus Problem Mubashir Khan Microsoft Dot NET Framework Forms 3 7th Sep 2005 07:01 AM
OnGotFocus Problem Mubashir Khan Microsoft Dot NET 1 6th Sep 2005 09:52 AM
What use OnGotFocus? Phill. W Microsoft VB .NET 1 9th Jun 2004 10:30 AM
OnGotFocus Joshua Moore Microsoft Dot NET Framework 1 24th Mar 2004 07:29 PM
textbox OnGotFocus-where? Gabor Microsoft VB .NET 4 30th Jan 2004 02:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:06 PM.