Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method to set all controls Enabled property to false
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Method to set all controls Enabled property to false
Versions des environnements
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01319086
Message ID:
01319086
Vues:
58
Hi everybody,

I'm working on UserControls. In each User Control I've added a Property called EditMode.
public partial class Coordinator_UCD_SpecialFriend : System.Web.UI.UserControl
{    
    #region Custom Properties
    ///
    /// <summary>The EditMode property is responsible for the Enabled style of the controls</summary>
    ///
 
    private bool editMode ;
    [Description("The EditMode property is responsible for the Enabled style of the controls"), DefaultValue(true)]  
    public bool EditMode
    {
        get { return editMode ; }
        set {
            editMode = value;           
        }
    }
    #endregion
When I set this property, I want to set all its inner controls Enabled property to the passed value.

Also can I have this as a static method in our public static class? If yes, what should I pass to this method?

In VFP I would do something like
this.EditMode = value
myStaticClass.SetEnabledProperty(this, value)
and the SetEnabledProperty method would be something like
lparameter loObject as Control
for each loControls in loObject.Controls
  ...
next
How can I translate something like this into C# code?

Thanks in advance for the ideas.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform