Solved

How do I Detect Parents WindowState.

Posted on 1997-11-21
4
445 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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 …
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…
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…

740 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