Thank you very much for your answer. I'd really
appreciate it if you could tell me a little bit to help me
understand how it works. The first part is obvious, but I
don't know when WndProc gets called or what the possible
values of m.Msg are and what they mean.
I used the debugger and set a break on the line
NeedValidting=false. It never got executed as I nagivated
my form.
I then set the break on the line: If m.Msg = &H10
Then and it got executed many many times.
Specific questions:
Is this (overridden) version WndProc called just for my
valididatedTextBox objects, or for all objects on the form?
Where can I find the meaning of the values m.Msg takes?
Where does WndProc fit in to the overall scheme of event
processing in windows?
Another more general question. I often use the help in
Visual Studio to find out what a class or property does.
(for example searching for WndProc.) All too often the VS
help just gives the arguments to use in the call or the
type of the property, but doesn't tell what it really does
or give the overall context of how that class is used. Is
there a better source of documentation that I could be
using? I am a scientist with 30 years of programming
experience, but am completely new at doing windows
interfaces and fairly new at OOP. Finding the right
classes to do something has been quite difficult and any
pointers you can give me about how to find information
would be greatly appreciated. Note that I have read of
couple of books on visual Basic and written the sample
programs already. Its just that everytime I try to do
something a little different that I don't know how to find
the information about the classes to use.
Thank you very much.
Tom
-----Original Message-----
Add following code in winform:
Private NeedValidting As Boolean = True
Private Sub TextBox1_Validating(ByVal sender As
Object, ByVal e As System.ComponentModel.CancelEventArgs)
Handles TextBox1.Validating If NeedValidting Then
'Do Validating
End If
End Sub
Protected Overrides Sub WndProc(ByRef m As
System.Windows.Forms.Message) If m.Msg = &H10 Then
NeedValidting = False
End If
MyBase.WndProc(m)
End Sub
.