[Gambas-user] Set all fields(contol.value) on a panel to a default value?
Bruce Steers
bsteers4 at gmail.com
Sat May 6 19:46:51 CEST 2023
On Sat, 6 May 2023 at 18:07, Dag JNJ <gambas at cd-bahia.com> wrote:
> Hi all,
> I am on a project with some SQL tables, similar GUIs with some fields on a
> normal panel. I make one function to clear all the fields the user can see.
> But I think I remember I saw a loop with *for each* we´here the controls
> have been manipulated, e.g. change value.
>
> I tried something like this
>
> *Public Sub Sta_Adr_clearfields_bt_Click()*
>
> * Dim xtb As TextBox*
>
> * For Each xtb In Sta_Adr_data_pnl*
> * xtb.Text = ""*
> * Next*
> *End*
>
> I get *Sta_Adr_data_pnl* is not an enumeration (I had to translate from
> German by myself, hope that's the word).
> Either the syntax is wrong or I remember wrong.
>
> Any help? Thanks in advance
> Dag
>
I assume *Sta_Adr_data_pnl** is a Panel*
*So you need **Sta_Adr_data_pnl**.Children*
assuming ALL contents of *Sta_Adr_data_pnl** are textbox*
*BruceS*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230506/504d1e7e/attachment.htm>
More information about the User
mailing list