<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css">
<title>
Gambas Documentation - Window Activation &amp; Deactivation
</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../help+en"><img class="flag" alt="Home" border="0" src="../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../doc+en">Up</a>&nbsp;
<a href="window+en">Previous</a>&nbsp;
<a href="../error+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
Window Activation &amp; Deactivation
</h1>
To become the official active window, i.e. the window that is returned by the <a href="../comp/gb.qt/application/activewindow+en">Application.ActiveWindow</a> property, a window:
<ul>
<li>Must be a top-level window.
<li>Or must implement the <tt>Form_Activate</tt> event handler.
<p>
</ul>

When a control gets the focus, then its window becomes the active window, provided this window can become the current active window as explained above.
<p>
If its window cannot become the current active window, then the parent window of this window is tried, and so on, until a top-level window is reached.
<p>
Activating a window sends a <a href="../comp/gb.qt/window/_deactivate+en">Deactivate</a> event to the old current active window, and an <a href="../comp/gb.qt/window/_activate+en">Activate</a> event to the new one.
<p>
When the application is iconified, the current active window is deactivated. When the application is uniconified, then the current active window is reactivated again.

</div>
</body>
</html>

