Solved

How do I Detect Parents WindowState.

Posted on 1997-11-21
4
446 Views
Last Modified: 2012-06-21
How Can A Usercontrol Detect Changes In The Windowstate Of Its Parent?

From Tim Brockway.   Email : BROCKWAYJT@AOL.COM
Version= VB5

PROBLEM DESCRIPTION.

How can a UserControl detect changes in the WindowState of its parent / containing form??

Yes I know I could call the usercontrol from the Forms resize event passing the new parent WindowState. But I'm looking for a way of intercepting the changes without having the user controls parent do any coding.

In essence I want to pick up the parents window change event from within the "child" usercontrol. Solution must be VB based.

Any ideas ? Any thoughts would be most welcome.

Many thanks,
Tim
0
Comment
Question by:brockway
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 8

Expert Comment

by:mrmick
ID: 1441884
Reference it like this:

Extender.Parent.WindowState
0
 

Author Comment

by:brockway
ID: 1441885
Sorry I should have made the question clearer.

 When I said "INTERCEPTING" I meant just that, not detecting later. In other words I want the usercontrol to be alerted or detect the Parent form windowstate change AS IT HAPPENS not next time the UserControl is invoked.

Put another way I want the usercontrol to be aware contemporaniously of the Parents Resize event triggering.

This is a toughy but if we could solve it , it would have a lot of applications.

Many thanks for the thoughts. Keep up the good work.

Tim.
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1441886
hmmm...
0
 
LVL 8

Accepted Solution

by:
mrmick earned 200 total points
ID: 1441887
Try Extensibility Object.  Check it out by clicking project, then click references, then click Microsoft Visual Basic 5.0 Extensibility.

I don't know for sure, but I think this method may only work in the IDE.  So, if you only need the form information when developers are placing or developing against your control, this will do it.  If you need access to the form stuff outside of the IDE, I'm not sure if the Extensibility object model can be used in this way.  Check it out yourself in the Visual Basic Component Tools Guide Page. 661 "Extending the Visual Basic Environment with Add-Ins".  IF you decide to try it, try the short example on page 667.  It points out a few peculiarities you’ll need to know.

Other then that, you'll have to call a method in your UserControls parent form resize event.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

710 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