• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Control类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: TextureGumpling

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


示例17: CanRender

 /// <summary>
 /// Returns <see langword="true"/> if the instance can render <paramref name="control"/>; otherwise <see langword="false"/>.
 /// </summary>
 /// <param name="control">The control to be rendered.</param>
 /// <returns><see langword="true"/> if the instance can render <paramref name="control"/>; otherwise <see langword="false"/>.</returns>
 public override bool CanRender(Control control)
 {
     Type controlType = control.GetType();
     return controlType == typeof(HeadingControl)
         || controlType == typeof(LabelControl)
         || controlType == typeof(HtmlControl);
 }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:12,代码来源:ContentControlRenderer.cs


示例18: ATIGPU

        public ATIGPU(string name, int adapterIndex, int busNumber, int deviceNumber, ISettings settings)
            : base(name, new Identifier("atigpu", adapterIndex.ToString(CultureInfo.InvariantCulture)), settings)
        {
            this.adapterIndex = adapterIndex;
            this.busNumber = busNumber;
            this.deviceNumber = deviceNumber;

            this.temperature = new Sensor("GPU Core", 0, SensorType.Temperature, this, settings);
            this.fan = new Sensor("GPU Fan", 0, SensorType.Fan, this, settings);
            this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this, settings);
            this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this, settings);
            this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this, settings);
            this.coreLoad = new Sensor("GPU Core", 0, SensorType.Load, this, settings);
            this.controlSensor = new Sensor("GPU Fan", 0, SensorType.Control, this, settings);

            ADLOD6ThermalControllerCaps adltcc = new ADLOD6ThermalControllerCaps();
            if (ADL.ADL_Overdrive6_ThermalController_Caps(adapterIndex, ref adltcc) != ADL.ADL_OK)
            {
                adltcc.iFanMinPercent = 0;
                adltcc.iFanMaxPercent = 100;
            }

            this.fanControl = new Control(controlSensor, settings, adltcc.iFanMinPercent, adltcc.iFanMaxPercent);
            this.fanControl.ControlModeChanged += ControlModeChanged;
            this.fanControl.SoftwareControlValueChanged += SoftwareControlValueChanged;
            ControlModeChanged(fanControl);
            this.controlSensor.Control = fanControl;
            Update();
        }
开发者ID:kurdtkobain,项目名称:openhardwaremonitor,代码行数:29,代码来源:ATIGPU.cs


示例19: Evaluate

        public void Evaluate(GameTime gameTime, Control focused, UserInterface ui)
        {
            ui.FindControls(Position, _controls);

            foreach (var item in _cooled)
                item.HeatCount--;
            foreach (var item in _warmed)
                item.HeatCount++;

            var type = typeof(MouseDevice);

            for (int i = 0; i < _controls.Count; i++)
            {
                _controls[i].Gestures.Evaluate(gameTime, this);

                if (_controls[i].Gestures.BlockedDevices.Contains(type))
                    break;
            }

            ui.EvaluateGlobalGestures(gameTime, this);

            _previous.Clear();
            _previous.AddRange(_controls);
            _blocked.Clear();
            _controls.Clear();
        }
开发者ID:xoxota99,项目名称:Myre,代码行数:26,代码来源:MouseDevice.cs


示例20: ImageBox

 /// <summary>
 /// Initializes a new instance of the <see cref="ImageBox"/> class.
 /// </summary>
 /// <param name="parent">This controls parent control.</param>
 /// <param name="texture">The texture.</param>
 /// <param name="colour">The colour.</param>
 /// <param name="sourceRectangle">The source rectangle.</param>
 public ImageBox(Control parent, Texture2D texture, Color colour, Rectangle? sourceRectangle)
     : base(parent)
 {
     Texture = texture;
     SourceRectangle = sourceRectangle;
     Colour = colour;
 }
开发者ID:xoxota99,项目名称:Myre,代码行数:14,代码来源:ImageBox.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ControlCollection类代码示例发布时间:2022-05-24
下一篇:
C# Contracts.ChassisResponse类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap