B4J Question [solved] Screen coordinates no working properly

jroriz

Active Member
Licensed User
Longtime User
Hi.

I'm trying to use AWTRobot's mousemove. Not working properly. The mouse does not go to the coordinates correctly.
So I tried a simple example, positioning a form. It's also not working.
Works properly on windows 7.
What could be happening?
The code below positions the form incorrectly, as can be seen in the image below.

B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.BackColor=fx.Colors.Cyan
    MainForm.Show
   
    Dim f As Form
    f.Initialize("",100,100)
    f.WindowLeft=MainForm.WindowLeft
    f.WindowTop = f.WindowTop
    f.BackColor=fx.Colors.Blue
    f.Show
End Sub

Resultado:


Windows 10 64 bits.
 

Roycefer

Well-Known Member
Licensed User
Longtime User
The code you posted is behaving correctly. The Form f is aligning left with MainForm. And the Form f is aligning top with itself. Just as your code dictates.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…