[Gambas-user] Rule to set form Height

Bruce Steers bsteers4 at gmail.com
Fri Apr 30 21:59:37 CEST 2021


Your window changing command runs the Form_Resize() event again as it
resizes the form., the command becomes recursive.

You should try something like...
Public bResizing As Boolean

Public Form_Resize()

If bresizing Then Return

bResizing = True

Form.Width= wVal
Form.Height = hVal

bResizing = False
End

Or something like that, then if Form_Resize is called while it is manually
resizing it will not run again

possibly could do the same using
Object.Lock(Me)
' resize commands
Object.Unlock(Me)
BruceS



On Fri, 30 Apr 2021 at 18:52, Safiur Rahman <isafiur at gmail.com> wrote:

> Hi
>
> In a module (Module1):
>
> Private $DeskHeight As Integer = 1150 ''1200 ''1386 ''1100
>
> Public Sub SetFromSize(frm As Form)
>
>   Print CStr(Now()) & " : " & $DeskHeight
>   frm.Height = $DeskHeight
>   frm.Width = Screen.AvailableWidth
>   frm.Left = 0
>   frm.Top = 0
>
> End
>
> In a form:
>
> Public Sub Form_Resize()
>
>   Module1.SetFromSize(Me)
>
> End
>
> If form Height =1150 or 1200 then the procedure runs several times
> If form Height = 1100 or 1386 then the process runs one or two times.
>
> Is there any rule to set form height? I am using QT5.
>
>
> --
> Regards
> Safiur Rahman
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210430/8584eefe/attachment.htm>


More information about the User mailing list