Solved

LostFocus

Posted on 1998-03-21
2
575 Views
Last Modified: 2008-03-17
When moving from one MDI-child to another i don´t want some LostFocus events to be fired. I use the    
=> If Screen.ActiveForm.hWnd <> Me.hWnd Then Exit Sub
on some controls but how to do this i i have a ActiveX-Control in a MDI-Child and the ActiveX-Control contins a grid where i don´t want the SS_LeaveCell event to be fired.

I have try with this sample but the Screen.ActiveForm is not set when I am in the grid in the ActiveX-Control.

Private Sub SS_LeaveCell(ByVal Col As Long, ByVal Row As Long, ByVal NewCol As Long, ByVal NewRow As Long, Cancel As Boolean)

    If UserControl.Parent.hWnd <> Screen.ActiveForm.hWnd Then Exit Sub
    'My other code after this....
      
End Sub
0
Comment
Question by:jannea
2 Comments
 

Accepted Solution

by:
Acid_Buzz earned 50 total points
ID: 1459537
Try to use a boolean property, replacing Scree.ActiveForm.. set it to true when form gotfocus or form is activate and false when form lost focus.. this is more easy to know how the form is activate..
0
 
LVL 1

Author Comment

by:jannea
ID: 1459538
Sorry Buzz, I´ll been gone for a while...

OK but, how to from my OCX find out the hWnd of the form who´s contain my OCX, that´s my mainproblem...
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
String manipulation in Visual Basic 7 62
Run code from text file in vb 1 64
Access query that references subform 5 47
MS Date Picker 64 bit 32 bit issue 12 53
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question