[Gambas-user] What is the use of Tag property

Fabien Bodard gambas.fr at ...626...
Sat Dec 11 18:35:45 CET 2010


many things ... you can embed in it any data you need withe the
object... it is a variant so it can be string, numbers, objects.

ex :

For i = 0 to 10


hButton = New Button(ME) as "Button"

hButton.Text = "Button " & i
hButton.Tag  = i


NEXT

END


PUBLIC SUB Button_Click()

  Select Case LAST.Tag
    Case 1
      Print "Button One Pressed"
    Case 2
      Print "Button Two Pressed"
    Case 3 to 10
      Print "Buttons between Three ans Ten pressed"
    Case else
       Print "lol What is this button ... from where does it come from ?
  end select

end







2010/12/11 Demosthenes Koptsis <demosthenesk at ...626...>:
> PROPERTY Tag AS Variant
>
> Returns or sets the control tag.
>
> This property is intended for the programmer and is never used by the
> component. It can contain any Variant value.
> ------------------------------------------------
>
> ok but what is the use of this property?
>
>
> --
> Regards,
> Demosthenes Koptsis.
>
>
> ------------------------------------------------------------------------------
> Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
> new data types, scalar functions, improved concurrency, built-in packages,
> OCI, SQL*Plus, data movement tools, best practices and more.
> http://p.sf.net/sfu/oracle-sfdev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Fabien Bodard




More information about the User mailing list