[Gtk-sharp-list] Loop through all components in Window

Fredre Hattingh hattingh.fredre at gmail.com
Sat Aug 25 13:56:43 EDT 2007


Hi sorry if this has been asked before.

I created a GTK# interface using Monodevelop. With a number of Label
widgets inside a Table container

The form is displayed just fine but now I want to loop through all the
Label widgets and based on the widgets name do something to it. For
example:

Loop through all Label widgets on form
{
  If(widgets name = Label1)
   {
    Label1.Hide()
   }
  If(widgets name = Label2)
   {
    Label2.Hide()
   }
...
}

Is there a way to loop through all the Labels (or other widgets) get
the name of the Label and then based on the name do something to the
Label ?

Kind Regards

Fredre Hattingh


More information about the Gtk-sharp-list mailing list