B4J Question MainForm Size in %x and %Y

Douglas Farias

Expert
Licensed User
Longtime User
Hi
How can i set the mainform size in %x and %y ? when i use this values with % dont compile and give error.

I need to use this, my app need of this on all screens possible.

Left = 20%x
Width = 80%x
Height = 75%y
Top = 25%y

How can i set this values on the main form?
 

Douglas Farias

Expert
Licensed User
Longtime User
any other way to set the form site responsive? like %x and %y?
i dont know if use fix values like 800 600 are a good way :(
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
i am not sure if this is right but may be it works?

B4X:
Sub jperxtocurrent(value As Int) As int
Dim x As Int

x = value/100 * MainForm.Width

Return x

End Sub
 
Upvote 0
Top