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


C# Control类代码示例

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


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

示例1: GetControlsHTML

 public string GetControlsHTML(Control c)
 {
     System.IO.StringWriter sw = new System.IO.StringWriter();
     HtmlTextWriter hw = new HtmlTextWriter(sw);
     c.RenderControl(hw);
     return sw.ToString();
 }
开发者ID:fping1245,项目名称:test20121224,代码行数:7,代码来源:clssche.aspx.cs

示例2: InstantiateIn

        public void InstantiateIn(Control container)
        {

            PlaceHolder templatePlaceHolder = new PlaceHolder();
            container.Controls.Add(templatePlaceHolder);
            templatePlaceHolder.DataBinding += new EventHandler(DataBindTemplate);
        }
开发者ID:veraveramanolo,项目名称:power-show,代码行数:7,代码来源:cs_ondemand_virtual_scroll.aspx.cs

示例3: ExpandableScroll

 public ExpandableScroll(Control owner, int page, int x, int y, int height)
     : base(0, 0)
 {
     m_owner = owner;
     Position = new Point(x, y);
     m_expandableScrollHeight = height;
 }
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:7,代码来源:ExpandableScroll.cs

示例4: DeleteCheckedItems

    //-------------------------------------------------------------------------------------------
    public void DeleteCheckedItems(SqlTransaction transaction, Control parent)
    {
        //foreach (Control control in parent.Controls)
          //{
          //     if (control.GetType() == typeof(CheckBox))
          //     {
          //          CheckBox item = (CheckBox)control;
          //          if (item.Checked)
          //          {
          //               Guid itemId = new Guid(item.Attributes["datakey"]);
          //               DataRowLookup reverseLookup = DatabaseHelper.Session.Get<DataRowLookup>(itemId);
          //               if (reverseLookup != null)
          //               {
          //                    SqlCommand command = new SqlCommand("delete from " + reverseLookup.TableName + " where [email protected]", wvvrdb.MSSQLDB);
          //                    command.Parameters.AddWithValue("Id", reverseLookup.RowId);
          //                    command.Transaction = transaction;
          //                    command.ExecuteNonQuery();
          //               }

          //               string sql = "delete from system_datalinks where ([email protected] and [email protected]) ";
          //               sql += "or ([email protected] and [email protected])";
          //               SqlCommand dataLinks = new SqlCommand(sql, wvvrdb.MSSQLDB);
          //               dataLinks.Parameters.AddWithValue("Object1", itemId);
          //               dataLinks.Parameters.AddWithValue("Object2", new Guid(Request["id"]));
          //               dataLinks.Transaction = transaction;
          //               dataLinks.ExecuteNonQuery();
          //          }
          //     }
          //     if (control.HasControls())
          //     {
          //          DeleteCheckedItems(transaction, control);
          //     }
          //}
    }
开发者ID:weavver,项目名称:weavver,代码行数:35,代码来源:DeleteObject.aspx.cs

示例5: TreeNode

        public TreeNode(Control control)
        {
            Control = control;
            Type = control.GetType().Name;

            var classesChanged = Observable.FromEventPattern<
                    NotifyCollectionChangedEventHandler, 
                    NotifyCollectionChangedEventArgs>(
                x => control.Classes.CollectionChanged += x,
                x => control.Classes.CollectionChanged -= x);

            classesChanged.Select(_ => Unit.Default)
                .StartWith(Unit.Default)
                .Subscribe(_ =>
                {
                    if (control.Classes.Count > 0)
                    {
                        Classes = "(" + string.Join(" ", control.Classes) + ")";
                    }
                    else
                    {
                        Classes = string.Empty;
                    }
                });
        }
开发者ID:Arlorean,项目名称:Perspex,代码行数:25,代码来源:TreeNode.cs

示例6: SuspendDrawing

    public static void SuspendDrawing(Control c)
    {
        if (c == null)
            throw new ArgumentNullException("c");

        WindowsApiMethods.SendMessage(c.Handle, (Int32)WM_SETREDRAW, (Int32)0, (Int32)0);
    }
开发者ID:verebes,项目名称:xml_form_editor,代码行数:7,代码来源:WindowsApiMethods.cs

示例7: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            stackControls.Visibility = Visibility.Hidden;

            Control = new Control();
        }
开发者ID:gaborGit,项目名称:DllTest2,代码行数:7,代码来源:MainWindow.xaml.cs

示例8: InstantiateIn

 //Overwrite InstantiateIn() method of ITemplate interface.
 public void InstantiateIn(Control container)
 {
     if (Page == 1)
     {
         //Code to create the ItemTemplate and its field.
         if (myListItemType == ListItemType.Item)
         {
             Label lbl = new Label();
             lbl.ID = "LblAttendanceType" + subjectID + subscript;
             lbl.Text = text;
             container.Controls.Add(lbl);
         }
     }
     else
     {
         //Code to create the ItemTemplate and its field.
         if (myListItemType == ListItemType.Item)
         {
             Label lbl = new Label();
             lbl.ID = "LblAttendanceType" + date + lectureID;
             lbl.Text = "fedfesgdsg";
             container.Controls.Add(lbl);
         }
     }
 }
开发者ID:priyanshu92,项目名称:AttendanceManagementSystem,代码行数:26,代码来源:CreateItemTemplate.cs

示例9: ControlAdapter

        /// <summary>
        /// Init.
        /// </summary>
        public ControlAdapter(Control control)
            : base(PerspexAdapter.Instance)
        {
            ArgChecker.AssertArgNotNull(control, "control");

            _control = control;
        }
开发者ID:Arlorean,项目名称:Perspex,代码行数:10,代码来源:ControlAdapter.cs

示例10: DrawGridFooter

 protected void DrawGridFooter(HtmlTextWriter output, Control ctl)
 {
     for (int i = 1; i < 4; i++)
     {
         output.Write("<tr>");
         output.Write("<td height='22'>预选");
         output.Write(i.ToString() + "</td>");
         output.Write("<td bgcolor='#ffffff'>&nbsp;</td>");
         output.Write("<td bgcolor='#ffffff'>&nbsp;</td>");
         for (int k = 0; k < 0x1c; k++)
         {
             output.Write("<td bgcolor='#fdfcdf' onClick=Style(this,'#ff0000','#fdfcdf') style='color:#fdfcdf; cursor:pointer;' ><strong>");
             output.Write(k.ToString() + "</td>");
         }
     }
     output.Write("<tr align='center' valign='center' bgcolor='#e8f1f8' height='18px'>");
     output.Write("<td rowspan='3' >期号</td>");
     output.Write("<td rowspan='3' >开奖号码</td>");
     output.Write("<td rowspan='2' >和值</td>");
     for (int j = 0; j < 0x1c; j++)
     {
         output.Write("<td ><font color='blue'>");
         output.Write(j.ToString() + "</font></td>");
     }
     output.Write("<tr align='center' valign='middle' bgcolor='#e8f1f8' >");
     output.Write("<td colspan='28' height='18px'>位置分布</td>");
     output.Write("<tr align='center' valign='middle' bgcolor='#e8f1f8'>");
     output.Write("<td colspan='29'  height='18px'><strong><font color='red'>和值走势</font></strong></td>");
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:29,代码来源:SHSSL_HZ.aspx.cs

示例11: GetStacked

    public static TableLayoutPanel GetStacked(Control[] controls, string[] widths)
    {
        TableLayoutPanel layout = new TableLayoutPanel();
        layout.Dock = DockStyle.Fill;
        layout.ColumnCount = 1;
        layout.RowCount = controls.Length;

        foreach (string width in widths) {
            float val = 0F;
            SizeType tp = SizeType.Absolute;
            if (width.EndsWith("%")) {
                val = (float) Convert.ToDouble(width.Remove(width.Length - 1));
                tp = SizeType.Percent;
            } else {
                val = (float) Convert.ToDouble(width);
            }
            layout.RowStyles.Add(new RowStyle(tp, val));
        }

        foreach (Control c in controls) {
            c.Dock = DockStyle.Fill;
            layout.Controls.Add(c);
        }
        return layout;
    }
开发者ID:numerodix,项目名称:solarbeam,代码行数:25,代码来源:ComboInputTest.cs

示例12: ControlInvokation

 public ControlInvokation(Token Source, Control Control, List<Node> Arguments, Node Body)
     : base(Source)
 {
     this.Control = Control;
     this.Arguments = Arguments;
     this.Body = Body;
 }
开发者ID:Blecki,项目名称:EtcScript,代码行数:7,代码来源:ControlInvokation.cs

示例13: SetObject

        public virtual void SetObject(Control control, object data) {
            if (control == null) {
                throw new ArgumentNullException("control");
            }

            CallbackMethod.Invoke(control, new object[] {data});
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ConsumerConnectionPoint.cs

示例14: DrawGridFooter

 private void DrawGridFooter(HtmlTextWriter output, Control ctl)
 {
     int num = this.RadioSelete();
     output.Write("<td width = '100px' height='50px'>");
     output.Write("出现次数</td>");
     output.Write("<td width = '100px'>");
     output.Write("&nbsp</td>");
     for (int i = 2; i < this.GridView1.Columns.Count; i++)
     {
         int num3 = 0;
         for (int j = 0; j < this.GridView1.Rows.Count; j++)
         {
             if ((this.GridView1.Rows[j].Cells[i].Text == "0") || (this.GridView1.Rows[j].Cells[i].Text == "1"))
             {
                 //num3 = num3;
                 this.num[i - 2] = num3;
                 this.sum[i - 2] = (num3 * 50) / num;
             }
             if ((((this.GridView1.Rows[j].Cells[i].Text == "2") || (this.GridView1.Rows[j].Cells[i].Text == "3")) || ((this.GridView1.Rows[j].Cells[i].Text == "4") || (this.GridView1.Rows[j].Cells[i].Text == "5"))) || ((this.GridView1.Rows[j].Cells[i].Text == "6") || (this.GridView1.Rows[j].Cells[i].Text == "7")))
             {
                 num3++;
                 this.num[i - 2] = num3;
                 this.sum[i - 2] = (num3 * 50) / num;
             }
         }
         output.Write("<td align='center' valign='bottom'>");
         output.Write(this.num[i - 2].ToString() + "<br><img src='../image/01[1].gif' height='" + this.sum[i - 2].ToString() + "px' title = '" + this.num[i - 2].ToString() + "' width= '8px'></td>");
     }
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:29,代码来源:7X_CF.aspx.cs

示例15: ShowDialog

		public DialogResult ShowDialog(Control parent, MessageBoxButtons buttons)
		{
			var caption = Caption ?? ((parent != null && parent.ParentWindow != null) ? parent.ParentWindow.Title : null);
            SWF.Control c = (parent == null) ? null : (SWF.Control)parent.ControlObject;
			SWF.DialogResult result = SWF.MessageBox.Show(c, Text, caption, Convert(buttons), Convert(Type));
			return Generator.Convert(result);
		}
开发者ID:hultqvist,项目名称:Eto,代码行数:7,代码来源:MessageBoxHandler.cs


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