Solved

LostFocus

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now