本文整理汇总了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();
}
示例2: InstantiateIn
public void InstantiateIn(Control container)
{
PlaceHolder templatePlaceHolder = new PlaceHolder();
container.Controls.Add(templatePlaceHolder);
templatePlaceHolder.DataBinding += new EventHandler(DataBindTemplate);
}
示例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;
}
示例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);
// }
//}
}
示例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;
}
});
}
示例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);
}
示例7: MainWindow
public MainWindow()
{
InitializeComponent();
stackControls.Visibility = Visibility.Hidden;
Control = new Control();
}
示例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);
}
}
}
示例9: ControlAdapter
/// <summary>
/// Init.
/// </summary>
public ControlAdapter(Control control)
: base(PerspexAdapter.Instance)
{
ArgChecker.AssertArgNotNull(control, "control");
_control = control;
}
示例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'> </td>");
output.Write("<td bgcolor='#ffffff'> </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>");
}
示例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;
}
示例12: ControlInvokation
public ControlInvokation(Token Source, Control Control, List<Node> Arguments, Node Body)
: base(Source)
{
this.Control = Control;
this.Arguments = Arguments;
this.Body = Body;
}
示例13: SetObject
public virtual void SetObject(Control control, object data) {
if (control == null) {
throw new ArgumentNullException("control");
}
CallbackMethod.Invoke(control, new object[] {data});
}
示例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(" </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>");
}
}
示例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);
}