Move a form without borders with Mask

Post Reply
User avatar
DavideTr
Posts: 4
Joined: Sunday 17th May 2020 8:20pm

Move a form without borders with Mask

Post by DavideTr » Sunday 17th May 2020 8:38pm

Hi everyone, I'm new to the Forum, sorry if I make some mistakes ..
I state that I have been developing software in Visual Basic, C ++, B4A and B4J for years, now I would like to learn Gambas to develop software for Linux. :D

Generally I love to draw the interface very well, this pushes me to prefer forms without borders ...

I searched one hour online for a solution without a useful result, my problem is the following: how do I move a Form by clicking on a PictureBox and dragging?

I tried to write this script by doing some tests, the Form moves but the problem is that it is moved only when the left mouse button is released .. I would like a smooth and real-time movement to be performed with the movement of the cursor, can someone help me? Thanks

'===== My Try =====

Code: Select all

Public Sub PictureBox1_MouseUp()
  'Verifica Tasto
  If Mouse.Left = True Then
   'Muovi Form
   Me.Move(Mouse.X, Mouse.Y)
  Endif 
End

User avatar
Quincunxian
Posts: 81
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: Move a form without borders with Mask

Post by Quincunxian » Sunday 17th May 2020 11:04pm

Hi DavideTr.
Welcome to the forum.

I needed to do this myself for a 'future project' so we both have a solution now.
This is just one way - there are potentially many more.
Attachments
MoveFormTest.tar.gz
Moving a Form without borders example
(14.11 KiB) Downloaded 8 times
Cheers - Quin.
I code therefore I am

User avatar
DavideTr
Posts: 4
Joined: Sunday 17th May 2020 8:20pm

Re: Move a form without borders with Mask

Post by DavideTr » Monday 18th May 2020 9:57am

Fantastic, thanks to your help I understood my mistake, I will adapt the script to my needs, you have been very kind, thanks. ;)

Post Reply