B4J Question Undecorated windows resize

moore_it

Well-Known Member
Licensed User
Longtime User
Hi all,

it's possible to resize an undecorated windows ?
Thanks
 

Cableguy

Expert
Licensed User
Longtime User
Set as Utility or just Undecorated?
Set as Utility I think you can't (directly) but Undecorated still has the borders so should be resizable.
 
Upvote 0

moore_it

Well-Known Member
Licensed User
Longtime User
i try to set
B4X:
mainform.resizable = True
but not work !
i think that a UNDECORATED form isn't resizable ...
 
Upvote 0

moore_it

Well-Known Member
Licensed User
Longtime User
I found a solution

B4X:
Sub MainForm_MousePressed (EventData As MouseEvent)
   ox = EventData.X
   oy = EventData.Y
End Sub

B4X:
Sub MainForm_MouseDragged (EventData As MouseEvent)
       Dim jo As JavaObject = EventData
       If oy > 0 And oy < 32 Then
           MainForm.WindowLeft = jo.RunMethod("getScreenX", Null) - ox
           MainForm.WindowTop = jo.RunMethod("getScreenY", Null) - oy
    End If
    If oy > MainForm.WindowHeight-24 And oy < MainForm.WindowHeight _
        And ox > MainForm.WindowWidth-24 And oy < MainForm.WindowWidth Then
           MainForm.WindowWidth = MainForm.WindowWidth + (EventData.X - ox)
           MainForm.WindowHeight = MainForm.WindowHeight + (EventData.Y - oy)
        oy = oy + (EventData.Y - oy)
        ox = ox + (EventData.X - ox)
    End If
End Sub
 
Upvote 0
Top