PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
LostFocus seems to fire when I load the form
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
LostFocus seems to fire when I load the form
![]() |
LostFocus seems to fire when I load the form |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi All,
I have a Windows MDI application which needs "modal type" dialog. Because this can't be done inside MDI I want to display the lookup window and have it close if the user clicks outside it. So I load the lookup form, and I have the following code in the LostFocus: <code> Private Sub Lookup1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus Me.Close() End Sub </code> However, as the form loads it goes through all it's usual load events and finally I get an InvalidOperationException (Value Close() cannot be called while doing CreateHandle()) Any ideas why the LostFocus is firing? Many thanks in advance! |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

