Solved

How do I Detect Parents WindowState.

Posted on 1997-11-21
4
448 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 4 hours left to enroll

615 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