Abbat, I'd go like this instead:
* Private _active As Boolean = False** 'This private form variable will hold the form's state ** Public Property Read IsActive As Boolean 'This property will return the private variable value** ** Private Function IsActive_Read() As Boolean 'The function declaration for reading the property** ** Return _active ' the current form state is returned** ** End** ** Public Sub Form_Activate() 'This sub will change the **private variable value to Active. ** _active = True** ' flag the state as Active. ** End** ** Public Sub Form_Deactivate()** 'This sub will change the **private variable value to Inactive.** ** _active = False** ' flag the state as Inactive.** ** End* >From any other form, module or class you can now check the new *IsActive* form property: * Dim myForm As New frmWithProperty 'Assume frmWithProperty has the above property code [... code ...] ** If myForm.IsActive Then [... code for when the form is active...] Else ** [... code for when the form is not active...] Endif [... even more code ...]* The property can be added the same way to a single, some, or all forms in the project. Regards, *On 05/02/2015 01:24 PM, Ru Vuott wrote:* > If you know visible-name of Form, you could use (gb.Desktop): > Public Sub Button1_Click() > Dim dw As DesktopWindow > For Each dw In Desktop.Windows > ' If the visible-name is the same as the name of the form that we seek, then > it detects that: > If dw.VisibleName = "visible-name of Form" then Print "Form is active !" > > Next > End > > -------------------------------------------- > *Sab 2/5/15, abbat81 <abbat...@mail.ru> ha scritto:* > Oggetto: [Gambas-user] How to know is my Form activated or not? > A: gambas-user@lists.sourceforge.net > Data: Sabato 2 maggio 2015, 13:43 > In Event I use *Form_Activate()* and > *Form_Deactivate()* > But I need to have boolean Y/N when I ask. > -- > View this message in context: > http://gambas.8142.n7.nabble.com/How-to-know-is-my-Form-activated-or-not-tp51426.html > Sent from the gambas-user mailing list archive at Nabble.com. > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user