Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checkbox.Checked Not There
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01408479
Message ID:
01408482
Vues:
31
Because oControl is of type Control, not RadioButton. There's no Checked property to the Control class. You have to cast it:
((RadioButton)oControl).Checked = Convert.ToBoolean(_DataRow[1]);
>Control oControl = null;
>Then later...
>oControl = new MyRadioButton();
>oControl.Text = sCaption;
>oControl.Checked = Convert.ToBoolean(_DataRow[1]);
>I'm getting
>'System.Windows.Forms.Control' does not contain a definition for 'Checked' and no extension method 'Checked' accepting a first argument of type 'System.Windows.Forms.Control' could be found
>Here's MyRadioButton
>class MyRadioButton : RadioButton
>{
>}
>So why isn't the Checked property there?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform