Solved

How do I Detect Parents WindowState.

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

12 Experts available now in Live!

Get 1:1 Help Now