Re: Customized IntegerTextBox problem
From: Jeremy Todd (jhtodd_at_uiuc.edu)
Date: 04/15/04
- Next message: rdi: "Re: Help needed returning variable values."
- Previous message: Sam: "outlook new message and richtextbox"
- Next in thread: Jeremy Todd: "Re: Customized IntegerTextBox problem"
- Reply: Jeremy Todd: "Re: Customized IntegerTextBox problem"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 15 Apr 2004 17:20:41 -0500
"Christian Soltenborn" <no_spam_csoltenborn@web.de> wrote in message
news:c5mgiq$3d1lt$1@ID-36219.news.uni-berlin.de...
> For this, I have two questions:
> a) If I override onTextChanged(), the method is called for every char
> entered. This would actually work for integers, but not for more complex
> data like a TimeSpan. Therefore I would like to override a method which
> is called if the complete data is entered (e.g. if the text box looses
> focus). Is there a way to do this?
Overriding OnValidating or OnValidated sounds like what you want.
OnValidating is most likely better, since it gives you the option of
stopping the control from losing focus if the input is invalid.
Also, be sure to call the base class method somewhere in there. In your
code, I notice there is no call to MyBase.OnTextChanged(e) in there
anywhere.
> b) I also could not figure out how I can give the focus back to my
> object after displaying the MessageBox. I didn't see anything like
> Me.SetFocus(), I can just ask if I have focus.
Me.Focus = True
My gut reaction is also that setting the focus should be a method and
not a property, but what can you do?
Jeremy
- Next message: rdi: "Re: Help needed returning variable values."
- Previous message: Sam: "outlook new message and richtextbox"
- Next in thread: Jeremy Todd: "Re: Customized IntegerTextBox problem"
- Reply: Jeremy Todd: "Re: Customized IntegerTextBox problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|