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


C# Forms.Control类代码示例

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


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


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