Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Elegant way to reference lots of check boxes
Message
 
À
29/09/2004 05:19:10
Peter Burton
Durham Aged Mineworkers Homes Associatio
Durham, Royaume Uni
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00947091
Message ID:
00947379
Vues:
17
Hi Peter,

If you are trying to access the checkboxes on a form, you can interate through all the controls and determine which ones are checkboxes. Here is some sample code:
foreach(Control oObj in this.Controls)
{
    if (oObj is CheckBox){
        ((CheckBox)oObj).Checked = <do something here> ;
    }
}
>Hi,
>
>I've inherited a database for a mailing list with lots of check boxes which I'm converting to VB.NET. Is there an elegant way to reference upwards of 25 check boxes in a class other than to have a property for each one? I'd quite like the users to be able to add their own columns at a later date! I'd thought of using a string with one letter for yes and a different one for no but I imagine that could get quite messy!
>
>Thanks
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform