Bug in Framework 1.1 with Enter/Leave Events

J

Jim Canale

I have an MDI app with two child forms open (FormA,
FormB). Each child form has two textboxes on it (text1,
text2). With the 1.0 framework, when you switch from one
child form to another, when you "leave" the textbox that
had the focus to go to the next textbox, it raises
a 'leave' event. Simply change the project to use the
1.1 framework and this doesn't happen. Any ideas on why
this is happening? Any fixes or a way to get back the
1.0 functionality? It appears to also ignore the
gotfocus/lost focus events too. Thanks.

Code:

MDI Parent Load

Dim a As New Form2
a.MdiParent = Me
a.Show()
Dim b As New Form2
b.MdiParent = Me
b.Show()

MDI ChildForm (Form2)

Private Sub Textbox1_LEAVE(...
textbox1.text = "" 'Put breakpoint here to verify prob
End Sub
 
J

James Hancock

I'm able to reproduce this behaviour in V1.0 functionality too.

The problem is that if they did it any other way, it would raise on message
boxes etc. (I asked during the VS.net 2003 beta.) so we get what we get. you
can do all of the work yourself in an overriden wndprc if you want.... it's
ugly and painful and you have to handle message boxes etc. but it does work.
 
J

Jim Canale

The example I provided works differently between the
versions. On 1.0, it will raise the enter/leave events
on a textbox, if you switch to a different child form and
then come back. It does not do this on 1.1. There is a
difference, for sure, and now my application doesn't work
(it's broke) where it did work before. Unfortunately, I
really wanted to upgrade to 2003 but it looks like I will
have to put that on hold.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top