Page 1 of 1

Move a form without borders with Mask

Posted: Sunday 17th May 2020 8:38pm
by DavideTr
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

Re: Move a form without borders with Mask

Posted: Sunday 17th May 2020 11:04pm
by Quincunxian
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.

Re: Move a form without borders with Mask

Posted: Monday 18th May 2020 9:57am
by DavideTr
Fantastic, thanks to your help I understood my mistake, I will adapt the script to my needs, you have been very kind, thanks. ;)