当前位置: 首页>>代码示例>>C#>>正文


C# ControlCollection类代码示例

本文整理汇总了C#中ControlCollection的典型用法代码示例。如果您正苦于以下问题:C# ControlCollection类的具体用法?C# ControlCollection怎么用?C# ControlCollection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ControlCollection类属于命名空间,在下文中一共展示了ControlCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Control

        public Control()
        {
            if (formSkin == null)
                formSkin = SharedInformation.ContentManager.Load<Texture2D>(@"data\fb\texture\wndskin.png");

            if (gulim8 == null)
                gulim8 = SharedInformation.ContentManager.Load<SpriteFont>(@"fb\Gulim8.xnb");

            if (gulim8B == null)
                gulim8B = SharedInformation.ContentManager.Load<SpriteFont>(@"fb\Gulim8b.xnb");

            if (tingSound == null)
                tingSound = SharedInformation.ContentManager.Load<SoundEffect>(@"data\wav\버튼소리.wav");

            _controls = new ControlCollection(this);
            _handle = GuiManager.Singleton.GetNewHandle();

            _foreColor = Color.Black;
            _backColor = Color.White;

            _text = "";

            _visible = true;
            _enabled = true;
            _tabStop = false;

            _zorder = 0;
            _font = Gulim8;
        }
开发者ID:GodLesZ,项目名称:FimbulwinterClient,代码行数:29,代码来源:Control.cs

示例2: LoadProperties

 protected void LoadProperties(string source)
 {
     XmlDocument document = new XmlDocument();
     document.LoadXml(source);
     XmlNodeList elementsByTagName = document.GetElementsByTagName("Property");
     this.mPropertyDoc = (XmlDocument) document.Clone();
     XmlElement element = this.mPropertyDoc.CreateElement("properties");
     string str = "";
     XmlNode newChild = null;
     foreach (XmlNode node2 in elementsByTagName)
     {
         XmlAttribute namedItem = (XmlAttribute) node2.Attributes.GetNamedItem("control");
         if (str != namedItem.Value)
         {
             newChild = element.OwnerDocument.CreateElement(namedItem.Value);
             element.AppendChild(newChild);
             str = namedItem.Value;
         }
         XmlElement element2 = newChild.OwnerDocument.CreateElement("Property");
         for (int i = 0; i < node2.Attributes.Count; i++)
         {
             element2.SetAttribute(node2.Attributes[i].Name, node2.Attributes[i].Value);
         }
         newChild.AppendChild(element2);
     }
     this.Controls = new ControlCollection(element.ChildNodes);
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:27,代码来源:PropertiesCollection.cs

示例3: RecurseControls

    private void RecurseControls(ControlCollection c)
    {
        // Only one of the passed controls will contain all the questions.
        int i = 0;
        foreach (Control con in c)
        {
            HtmlGenericControl hgc = con as HtmlGenericControl;
            if (hgc != null && hgc.TagName.ToUpperInvariant() == "H3")
            {
                if (hgc.Attributes["class"] == "question")
                {
                    string id = "q" + i.ToString();
                    hgc.Attributes.Add("id", id);

                    // Add to TOC
                    HtmlGenericControl tocItem = new HtmlGenericControl("li");
                    HtmlGenericControl anchor = new HtmlGenericControl("a");
                    anchor.Attributes.Add("href", "#" + id);
                    anchor.InnerText = hgc.InnerText;
                    tocItem.Controls.Add(anchor);
                    toc.Controls.Add(tocItem);

                    i++;
                }
            }

            this.RecurseControls(con.Controls);
        }
    }
开发者ID:tmzu,项目名称:keymapper,代码行数:29,代码来源:faq.aspx.cs

示例4: DisplayData

 protected void DisplayData(ControlCollection controls)
 {        
     foreach (KeyValuePair<string, string> item in (Dictionary<string,string>)ViewState["formData"])
     {            
         Label1.Text += item.Value + " ";
     }
 }
开发者ID:naynishchaughule,项目名称:ASP.NET,代码行数:7,代码来源:ApplicationForm.aspx.cs

示例5: Add

		/// <summary>
		/// Add one ControlCollection to another.  Combines them into one collection.
		/// </summary>
		/// <param name="collection">The collection to merge with this one.</param>
		public void Add(ControlCollection collection)
		{
			foreach(Control control in collection)
			{
				Add(control);
			}
		}
开发者ID:bbriggs,项目名称:wesay,代码行数:11,代码来源:ControlCollection.cs

示例6: ClearInputs

    //this method clears all the textboxes without actually calling all the seperate values
    private void ClearInputs(ControlCollection ctrls)
    {
        foreach (Control ctrl in ctrls)
        {
            if (ctrl is TextBox)
                ((TextBox)ctrl).Text = string.Empty;

            ClearInputs(ctrl.Controls);
        }
    }
开发者ID:scottbeachy,项目名称:SeniorProject,代码行数:11,代码来源:contact.aspx.cs

示例7: SetReadOnly

    private void SetReadOnly(bool isReadOnly, ControlCollection collection)
    {
        foreach (DictionaryEntry dic in DataControlCollection)
        {
            IWebDataControl dc = (IWebDataControl)dic.Value;
            dc.SetReadOnly(isReadOnly);
        }

        TxtVersion.SetReadOnly(true);
    }
开发者ID:HeyWeiPan,项目名称:WarehouseControlSystem,代码行数:10,代码来源:AppInformation.aspx.cs

示例8: ClearControls

 public void ClearControls(ControlCollection ctrl)
 {
    foreach(Control ctl in ctrl)
     {
         if(ctl is TextBox)
         {
             (ctl as TextBox).Text = " ";
         }
         ClearControls(ctl.Controls);
     }
 }
开发者ID:ananth039,项目名称:Anantha-Kumar-.net-Practice-programs,代码行数:11,代码来源:PostArticles.aspx.cs

示例9: CompositeControlBase

 protected CompositeControlBase()
 {
     _controls = new ControlCollection(this);
     _controls.ControlAdded += (sender, args) => ChangeControl(args.Control, true);
     _controls.ControlRemoved += (sender, args) => ChangeControl(args.Control, false);
     _controls.ControlsReset += (sender, args) =>
         {
             args.OldControls.ForEach(c => ChangeControl(c, false));
             args.NewControls.ForEach(c => ChangeControl(c, true));
         };
 }
开发者ID:jam40jeff,项目名称:CsJs,代码行数:11,代码来源:CompositeControlBase.cs

示例10: Control

 /// <summary>
 /// Initializes a new instance of the <see cref="Control"/> class.
 /// </summary>
 protected Control()
 {
     this.Name = this.DefaultName;
     if (this.CanContainAttributes)
     {
         this.attributes = new ControlAttributeCollection();
     }
     if (this.CanContainControls)
     {
         this.controls = new ControlCollection();
     }
 }
开发者ID:cathode,项目名称:Serenity,代码行数:15,代码来源:Control.cs

示例11: ClearInputs

    private void ClearInputs(ControlCollection ctrls)
    {
        foreach (Control ctrl in ctrls)
        {
            if (ctrl is TextBox)
                ((TextBox)ctrl).Text = string.Empty;
            else if (ctrl is DropDownList)
                ((DropDownList)ctrl).ClearSelection();

            ClearInputs(ctrl.Controls);
        }
    }
开发者ID:neonmax,项目名称:sims,代码行数:12,代码来源:AppointmentLogReport.aspx.cs

示例12: AttachVisibilityBindings

        public void AttachVisibilityBindings(ControlCollection controls)
        {
            for (int i = 0; (i < controls.Count); i = (i + 1))
            {
                if ((controls[i].DataBindings["Visible"] != null))
                {
                    // Attach event handlers to auto-hide controls.
                    controls[i].DataBindings["Visible"].Format += new System.Windows.Forms.ConvertEventHandler(this.Visibility_Format);
                    controls[i].DataBindings["Visible"].DataSourceUpdateMode = System.Windows.Forms.DataSourceUpdateMode.Never;
                }
            }

        }
开发者ID:Jevaan,项目名称:Strandmollen,代码行数:13,代码来源:BarcodesSummaryViewDialog.Designer.cs

示例13: SetControlPermission

    private void SetControlPermission(ControlCollection controlCollection)
    {

        //new TextBox().Attributes[]
        foreach (Control chilControl in controlCollection)
        {
            if ((chilControl as WebControl) != null)
                (chilControl as WebControl).Attributes["permissionRequired"] = "Service";
            if (chilControl.HasControls())
                SetControlPermission(chilControl.Controls);
        }

    }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:13,代码来源:Service.aspx.cs

示例14: ClearTextboxes

 public static void ClearTextboxes(ControlCollection cc)
 {
     foreach (Control ctrl in cc)
     {
         TextBox tb = ctrl as TextBox;
         if (tb != null)
         {
             tb.Text = "";
         }
         else
             ClearTextboxes(ctrl.Controls);
     }
 }
开发者ID:abramlimpin,项目名称:TaskTracker,代码行数:13,代码来源:Helper.cs

示例15: ClearControlsData

    //if clear the  values in form controls
    private void ClearControlsData(ControlCollection ctrl)
    {
        foreach (Control ctr in ctrl)
        {
            if (ctr is TextBox)
                (ctr as TextBox).Text = " ";
            if (ctr is DropDownList)
                (ctr as DropDownList).SelectedIndex = 0;
            ClearControlsData(ctr.Controls);

        }


    }
开发者ID:ananth039,项目名称:Anantha-Kumar-.net-Practice-programs,代码行数:15,代码来源:ForgetPassword.aspx.cs


注:本文中的ControlCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。