Page 2 of 2

Re: Warning message in IDE when running app

Posted: Saturday 4th December 2021 4:59pm
by BruceSteers
If you set the main forms Persistent property to True then i think it fixes it as the windows config is not destroyed when closing it.

I edited the prog a little to make it also use the "Stop Event" command if arrow keys are pressed with Ctrl otherwise the arrow keys were also changing button focus. using "Stop Event" stops the default key press things happening if you are doing other things :)
  If Key.Control And [Key.Up, Key.Down, Key.Left, Key.Right].Exist(Key.Code) Then 
    Moveform(Key.Code)
    Stop Event 
  Endif
and condensed it to run another function..
Public Sub Moveform(KeyCode As Integer)
  
  Select KeyCode
    Case Key.Up
      Dec Me.Window.Top
    Case Key.Down
      Inc Me.Window.Top
    Case Key.Left
      Dec Me.Window.Left
    Case Key.Right
      Inc Me.Window.Left
  End Select
  
End

Ignore the fact i used Me.Window.Top and not Me.Top I was experimenting to see if it made a difference.

Re: Warning message in IDE when running app

Posted: Saturday 4th December 2021 5:08pm
by BruceSteers
BruceSteers wrote: Saturday 4th December 2021 4:59pm If you set the main forms Persistent property to True then i think it fixes it as the windows config is not destroyed when closing it.
Eek sorry no it does not :(

gambas does have issues with form co-ords replacement. My desktop app will not work correctly either. if i change window border property it then gives wrong coords and when reloading the window is incorrectly positioned :(

Re: Warning message in IDE when running app

Posted: Saturday 11th December 2021 11:05pm
by Diverod
Just thought I’d post the final version of this utility after correcting a minor issue with displayed height. I really appreciate the help from Cogier with cleaning up the layout of the main form and general code improvement and BruceSteer for proper key code handling and his RunFree Class.

I still haven’t found a good alternative for the Wait command but eventually maybe something will come to me when I’m not thinking about it so hard. I learned a lot on this one, especially that I’ve got a lot more to learn.

Thanks to all, RodG.

Re: Warning message in IDE when running app

Posted: Sunday 12th December 2021 6:05pm
by BruceSteers
Diverod wrote: Saturday 11th December 2021 11:05pm Just thought I’d post the final version of this utility after correcting a minor issue with displayed height. I really appreciate the help from Cogier with cleaning up the layout of the main form and general code improvement and BruceSteer for proper key code handling and his RunFree Class.

I still haven’t found a good alternative for the Wait command but eventually maybe something will come to me when I’m not thinking about it so hard. I learned a lot on this one, especially that I’ve got a lot more to learn.

Thanks to all, RodG.
Cool app.

I have an idea about the wait issue.
Do not even hide the main form,
just capture the area inside the picturebox view.
hide the colour panel if needed and then grab the area of the PictureBox that's showing the screen beneath (as this is the area it looks like you'll get) not the entire form size area. then the main form can remain open, no more problem :)

Just a thought :)