473,405 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

OnGotFocus Problem

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);
}
Sep 6 '05 #1
1 2529
I have used OnEnter and OnLeave too. It works fine but TextAlign property is
causing problem. Any Clues ???

"Mubashir Khan" <mm***********@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
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);
}

Sep 6 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
1
by: Richard Grene | last post by:
After upgrading to 2003 my forms OnGotFocus does not fire? Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs) Any ideas? Thanks, Richard
3
by: Gabor | last post by:
I want to capture the textbox ongotfocus event, but it is missing in the event list. I found the Enter event, but it seems doesn't work. What I'm doing wrog? Thanks in advance Gabor
1
by: Phill. W | last post by:
How am I supposed to use a Control's Overridable On* Methods? I'm obviously missing something very important about them but they just don't seem to do anything for me :-( I have a UserControl...
1
by: Mubashir Khan | last post by:
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...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.