[Gambas-user] Calling Function for Array List Forms
Bruce Steers
bsteers4 at gmail.com
Wed May 12 21:30:15 CEST 2021
On Wed, 12 May 2021 at 12:58, Hasan Merkit <hasanmerkit at outlook.com> wrote:
> I want to changing a Form variable to Form Array (Form[])
>
>
>
>
>
>
>
>
>
> Private FormForThemeTimer As Form[]
>
> Public Sub Do(FormName As Form)
>
>
>
> If Not FormName = Null Then
>
> FormForThemeTimer.Add(FormName)
>
> Endif
>
>
>
> If Theme_DarkMode Then
>
> Forms_PaintDark(FormForThemeTimer)
>
> Else
>
> Forms_PaintDefault(FormForThemeTimer)
>
> End If
>
>
>
> End
>
>
>
>
>
>
>
> I want my app do this for example:
>
> FormForThemeTimer = [form1,form2,form3]
>
> If Theme_DarkMode Then
>
> Forms_PaintDark(form1)
>
> Forms_PaintDark(form2)
>
> Forms_PaintDark(form3)
>
> Else
>
> Forms_PaintDefault(form1)
>
> Forms_PaintDefault(form2)
>
> Forms_PaintDefault(form3)
>
> End If
>
>
>
> How?
>
if FormForThemeTimer is a Form[] Array of [Form1, Form2, Form3]
Then this...
If Theme_DarkMode Then Forms_PaintDark(FormForThemeTimer) Else
Forms_PaintDefault(FormForThemeTimer)
Public Sub PaintDark(FormArray As Form[])
For Each hForm As Form In FormArray
DoSomethingTo(hForm)
Next
End
hope that helps.
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210512/c9302f36/attachment.htm>
More information about the User
mailing list