B4J Question How to prevent my app from losing focus?

Cableguy

Expert
Licensed User
Longtime User
I am creating a transparent form app, that should behave as a widget...
For now all works OK, but I would also like to prevent my app from being pushed back in the z-order when another app is brought into focus...
How can this be achieved?
 

Daestrum

Expert
Licensed User
Longtime User
needs javaobject lib
B4X:
    .....
    AlwaysOnTop(MainForm,True)
End Sub
private Sub getStage(o As JavaObject) As JavaObject
    Return o.GetFieldJO("stage")
End Sub
Sub AlwaysOnTop(o As Form,boo As Boolean)
    getStage(o).RunMethod("setAlwaysOnTop",Array(boo))
End Sub
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
many Thanks
 
Upvote 0
Top