2010/1/27 Fiddler63 <mx4...@gmail.com>:

> In gambas I get an error if I give more that one button the same name.
> How do I index a row of buttons in Gambas ?

You don't. Gambas is not VB; it does not suppor, and rightly so,
arrays of control objects in the way that VB does; even the more
modern .NET revisions do not do it the way VB does. If you want more
than one object to do the very same thing then you use the control's
Group property.

If you need to know what item in the group was selected then, for
example, you use the Tag property. Or, perhaps the Caption property:

Public Sub mnuEdit_Click()

  Select Case mnuEdit.Caption
  Case $MNU_ITEM_EDIT_IDENTITY
     [...]
  Case $MNU_ITEM_EDIT_OPTIONS
     [...]
  Case $MNU_ITEM_NEW_OPTIONS
     [...]
  End selct

End

In the above code example, one menu item has three functions. The
function is determined by the context of the code.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to