Solved

LostFocus

Posted on 1998-03-21
2
576 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

821 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