本文整理汇总了C#中System.Windows.Forms.Control类的典型用法代码示例。如果您正苦于以下问题:C# Control类的具体用法?C# Control怎么用?C# Control使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Control类属于System.Windows.Forms命名空间,在下文中一共展示了Control类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: EventHandler
public void EventHandler(Control ctrl)
{
ctrl.MouseMove += new MouseEventHandler(OnMouseMove);
ctrl.MouseDown += new MouseEventHandler(OnMouseDown);
ctrl.MouseUp +=new MouseEventHandler(OnMouseUp);
ctrl.MouseDoubleClick += new MouseEventHandler(OnMouseDoubleClick);
}
开发者ID:mind0n,项目名称:hive,代码行数:7,代码来源:BasicForm.cs
示例2: BuildDirPanel
protected TextBox BuildDirPanel(Control parent, String name)
{
Panel panel = new Panel();
panel.Dock = DockStyle.Top;
panel.Height = 60;
Label l = new Label();
l.Location = new Point(0, 0);
l.Dock = DockStyle.Left;
l.Text = name;
l.AutoSize = true;
panel.Controls.Add(l);
TextBox textBox = new TextBox();
textBox.Location = new Point(10, 20);
textBox.Width = ((ICustPanel)this).PreferredSize.Width - 40;
panel.Controls.Add(textBox);
// Don't have a reasonable directory browser and don't feel
// like doing the P/Invoke for the underlying one. Sigh.
/*****
Button b = new Button();
b.Location = new Point(120, 20);
b.Width = 20;
b.Text = "...";
b.Tag = textBox;
b.Click += new EventHandler(DirButtonClicked);
panel.Controls.Add(b);
*****/
parent.Controls.Add(panel);
return textBox;
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:34,代码来源:CustDirPanel.cs
示例3: ViewContext
/// <summary>
/// Initialize a new instance of the ViewContext class.
/// </summary>
/// <param name="manager">Reference to the view manager.</param>
/// <param name="control">Control associated with rendering.</param>
/// <param name="alignControl">Control used for aligning elements.</param>
/// <param name="renderer">Rendering provider.</param>
public ViewContext(ViewManager manager,
Control control,
Control alignControl,
IRenderer renderer)
: this(manager, control, alignControl, null, renderer)
{
}
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:14,代码来源:ViewContext.cs
示例4: BrowseForFile
protected void BrowseForFile(Control target, string filter, TextBoxEditMode textBoxEditMode)
{
if (target == null) {
throw new ArgumentNullException("target");
}
new BrowseButtonEvent(this, target, filter, textBoxEditMode).Event(null, null);
}
开发者ID:ichengzi,项目名称:SharpDevelop,代码行数:7,代码来源:XmlFormsOptionPanel.cs
示例5: RtlTransform
public static Rectangle RtlTransform(Control control, Rectangle rectangle)
{
if (control.RightToLeft != RightToLeft.Yes)
return rectangle;
else
return new Rectangle(control.ClientRectangle.Right - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height);
}
开发者ID:hanistory,项目名称:hasuite,代码行数:7,代码来源:DrawHelper.cs
示例6: modello770TelematicoUCLoad
private void modello770TelematicoUCLoad(object sender, EventArgs e)
{
_listaRitenute = getRitenuteVersateService().GetLista(_condominio);
getRitenuteVersateService().SearchComplete += modello770TelematicoUCSearchComplete;
getRitenuteVersateService().SetAnno(DateTime.Today.Year - 1);
_listaRitenute.Dock = DockStyle.Fill;
splitContainer1.Panel1.Controls.Add(_listaRitenute);
_datiCertificazioneUC = new DatiCertificazioneUC {Dock = DockStyle.Fill};
splitContainer1.Panel2.Controls.Add(_datiCertificazioneUC);
sceltaFornitoreCombo1.LoadData();
dataDichiarazione.Value = DateTime.Today;
numeroIscrizioneCaf.Value = null;
validationSummarySceltaRitenute.Validators.Add(parametersValidator);
validationSummarySceltaRitenute.Validators.Add(ritenuteValidator);
validationSummaryCreazioneFile.Validators.Add(reqFile);
validationSummaryCreazioneFile.Validators.Add(reqDataDichiarazione);
validationSummaryCreazioneFile.Validators.Add(codiceFiscaleValidator);
validationSummaryCreazioneFile.Validators.Add(codiceFiscaleIntermediarioValidator);
Clear();
}
开发者ID:gipasoft,项目名称:Sfera,代码行数:27,代码来源:Modello770TelematicoUC.cs
示例7: CreateInputDevices
protected void CreateInputDevices(Control target)
{
// create keyboard device.
keyboard = new Device(SystemGuid.Keyboard);
if (keyboard == null)
{
throw new Exception("No keyboard found.");
}
// create mouse device.
mouse = new Device(SystemGuid.Mouse);
if (mouse == null)
{
throw new Exception("No mouse found.");
}
// set cooperative level.
keyboard.SetCooperativeLevel(target, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Background);
mouse.SetCooperativeLevel(target, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Background);
// Acquire devices for capturing.
keyboard.Acquire();
mouse.Acquire();
}
开发者ID:sakseichek,项目名称:homm,代码行数:25,代码来源:Poller.cs
示例8: HostControl
public void HostControl(Control c)
{
DocumentForm frm = new DocumentForm(c);
frm.ShowHint = DockState.Document;
frm.Show(m_dockPanel);
}
开发者ID:asymmetricsec,项目名称:oleviewdotnet,代码行数:7,代码来源:MainForm.cs
示例9: Vaildate
public string Vaildate()
{
string errortxt = string.Empty;
if (this.orderkey.Text.Length == 0)
{
focusControl = this.orderkey;
errortxt += "订单号必填";
}
if (this.checkuser.Text.Length == 0)
{
if (string.IsNullOrEmpty(errortxt))
focusControl = this.checkuser;
errortxt += "拣货员必填";
}
if (this.qty.Text.Length == 0)
{
if (string.IsNullOrEmpty(errortxt))
focusControl = this.qty;
errortxt += "分拣数必填";
}
return errortxt;
}
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:25,代码来源:FrmPODPick.cs
示例10: FindParentCardView
public static CardView FindParentCardView(Control control)
{
Control parent = control.Parent;
while(parent != control.FindForm() && !(parent is CardView))
parent = parent.Parent;
return parent as CardView;
}
开发者ID:calvinkwong,项目名称:pol-the-game,代码行数:7,代码来源:GameViewHelper.cs
示例11: FindParentPlayerView
public static PlayerView FindParentPlayerView(Control control)
{
Control parent = control.Parent;
while(parent != control.FindForm() && !(parent is PlayerView))
parent = parent.Parent;
return parent as PlayerView;
}
开发者ID:calvinkwong,项目名称:pol-the-game,代码行数:7,代码来源:GameViewHelper.cs
示例12: Capture
// Zero based device index and device params and output window
public Capture(int iDeviceNum, int iWidth, int iHeight, short iBPP, Control hControl)
{
DsDevice[] capDevices;
// Get the collection of video devices
capDevices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
if (iDeviceNum + 1 > capDevices.Length)
{
throw new Exception("No video capture devices found at that index!");
}
try
{
// Set up the capture graph
SetupGraph(capDevices[iDeviceNum], iWidth, iHeight, iBPP, hControl);
// tell the callback to ignore new images
m_PictureReady = new ManualResetEvent(false);
}
catch
{
Dispose();
throw;
}
}
开发者ID:SaintLoong,项目名称:RemoteControl_Server,代码行数:27,代码来源:Capture.cs
示例13: ThrowIfNotInWorkspace
/// <summary>
/// Check if control is in parent control.
/// </summary>
/// <param name="parent"></param>
/// <param name="spcontrol"></param>
public static void ThrowIfNotInWorkspace(Control parent, Control spcontrol)
{
if (parent.Controls.Contains(spcontrol) == false)
{
throw new ArgumentException(Resources.SmartPartNotInManager);
}
}
开发者ID:wuyingyou,项目名称:uniframework,代码行数:12,代码来源:WorkspaceUtilities.cs
示例14: IsContainer
static public bool IsContainer(Control control)
{
return
control is TabControl ||
control is TabPage ||
control is Panel;
}
开发者ID:1aurent,项目名称:CloudBackup,代码行数:7,代码来源:Utils.cs
示例15: GameContext
/// <summary>
/// Initializes a new instance of the <see cref="GameContext" /> class.
/// </summary>
/// <param name="control">The control.</param>
/// <param name="requestedWidth">Width of the requested.</param>
/// <param name="requestedHeight">Height of the requested.</param>
public GameContext(Control control, int requestedWidth = 0, int requestedHeight = 0)
{
Control = control ?? new RenderForm("SharpDX Game");
RequestedWidth = requestedWidth;
RequestedHeight = requestedHeight;
ContextType = GameContextType.Desktop;
}
开发者ID:rbwhitaker,项目名称:SharpDX,代码行数:13,代码来源:GameContext.Desktop.cs
示例16: create_tool_tip_for
public IApplicationWindow create_tool_tip_for(string title, string caption, Control control)
{
var tip = new ToolTip {IsBalloon = true, ToolTipTitle = title};
tip.SetToolTip(control, caption);
control.Controls.Add(new ControlAdapter(tip));
return this;
}
开发者ID:mokhan,项目名称:mo.money,代码行数:7,代码来源:ApplicationWindow.cs
示例17: GetLinkControlLocationBy
private static Point GetLinkControlLocationBy(Control activityControl, ActivityControlsLink activityControlsLink,
Control linkControl){
NeighbourDirections direction = activityControlsLink.Direction;
int x = activityControl.Location.X;
int y = activityControl.Location.Y;
if (direction == NeighbourDirections.Top){
x += 5;
y -= 5;
}
else if (direction == NeighbourDirections.Bottom) {
x += 5;
y += activityControl.Height - 5;
}
else if (direction == NeighbourDirections.Left){
x -= 5;
// y += 5;
}
else {//Right
x += activityControl.Width - 5;
// y += 5;
}
if (direction == NeighbourDirections.Top
|| direction == NeighbourDirections.Bottom) {
linkControl.Width = activityControl.Width - 10;
linkControl.Height = 10;
}
else{
linkControl.Height = activityControl.Height;// -10;
linkControl.Width = 10;
}
return new Point(x, y);
}
开发者ID:satr,项目名称:rvslite,代码行数:32,代码来源:DesignFieldControl.cs
示例18: Init
public static void Init(Control control, Control container, Direction direction)
{
bool Dragging = false;
Point DragStart = Point.Empty;
control.MouseDown += delegate(object sender, MouseEventArgs e)
{
Dragging = true;
DragStart = new Point(e.X, e.Y);
control.Capture = true;
};
control.MouseUp += delegate(object sender, MouseEventArgs e)
{
Dragging = false;
control.Capture = false;
};
control.MouseMove += delegate(object sender, MouseEventArgs e)
{
if (Dragging)
{
if (direction != Direction.Vertical)
container.Left = Math.Max(0, e.X + container.Left - DragStart.X);
if (direction != Direction.Horizontal)
container.Top = Math.Max(0, e.Y + container.Top - DragStart.Y);
}
};
}
开发者ID:aAmitSengar,项目名称:WindowsEditor,代码行数:29,代码来源:ControlMover.cs
示例19: Remove
/// <include file='doc\DataGridViewControlCollection.uex' path='docs/doc[@for="DataGridView.DataGridViewControlCollection.Remove"]/*' />
public override void Remove(Control value)
{
if (value != owner.horizScrollBar && value != owner.vertScrollBar && value != this.owner.editingPanel)
{
base.Remove(value);
}
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:DataGridViewControlCollection.cs
示例20: limpa
public void limpa(Control controls)
{
foreach (Control child in controls.Controls.Cast<Control>().OrderBy(c => c.TabIndex))
{
if (child is Label)
{ }
else if (child is Button)
{ }
else if (child is DataGridView)
{ }
else if (child is TextBox)
{
if (!string.IsNullOrEmpty(child.Text)
|| (!string.IsNullOrWhiteSpace(child.Text)
|| child.Text != string.Empty))
child.Text = "";
}
else if (child is MaskedTextBox)
{
((MaskedTextBox)child).TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
if ((!string.IsNullOrEmpty(child.Text) || !string.IsNullOrWhiteSpace(child.Text))
|| child.Text != string.Empty)
{
child.Text = "";
}
}
else if (child is ComboBox && ((ComboBox)child).SelectedIndex > 0)
{
((ComboBox)child).SelectedIndex = -1;
}
}
}
开发者ID:mateusrdgs,项目名称:semanaTec,代码行数:32,代码来源:cleanControls.cs
注:本文中的System.Windows.Forms.Control类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论