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


C# Forms.UserControl类代码示例

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


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

示例1: Form1

 public Form1(UserControl uc)
 {
     InitializeComponent();
     //this.Size = uc.Size;
     oUC = uc;
     
 }
开发者ID:Fucmeo,项目名称:ou-qlns,代码行数:7,代码来源:Form1.cs

示例2: ListView_SelectedIndexChanged

        private void ListView_SelectedIndexChanged( object sender, EventArgs e )
        {
            Point cursorPoint = this.ListView.PointToClient( Cursor.Position );
            ListViewItem listViewItem = this.ListView.GetItemAt( cursorPoint.X, cursorPoint.Y );
            if ( listViewItem == null )
                return;

            UserControl outDocumentFormSub1 = null;
            if ( m_AllDocumenInfo.TryGetValue( listViewItem, out outDocumentFormSub1 ) == false )
            {
                if ( this.m_CurrentDocumen != null )
                    this.m_CurrentDocumen.Visible = false;
            }
            else
            {
                if ( this.m_CurrentDocumen != null && outDocumentFormSub1 != this.m_CurrentDocumen )
                    this.m_CurrentDocumen.Visible = false;

                if ( outDocumentFormSub1 != null )
                {
                    outDocumentFormSub1.Visible = true;
                    this.m_CurrentDocumen = outDocumentFormSub1;
                }
            }
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:25,代码来源:Demo.Stock.SR.DocumentForm.cs

示例3: Configure

        /// <summary>
        /// Configures the editor</summary>
        /// <param name="treeControl">Control to display data</param>
        /// <param name="treeControlAdapter">Adapter to drive control. Its ITreeView should
        /// implement IInstancingContext and/or IHierarchicalInsertionContext.</param>
        /// <remarks>Default is to create a TreeControl and TreeControlAdapter,
        /// using the global image lists.</remarks>
        protected override void Configure(
            out TreeControl treeControl,
            out TreeControlAdapter treeControlAdapter)
        {
            treeControl = new TreeControl();
            treeControl.ImageList = ResourceUtil.GetImageList16();
            treeControl.StateImageList = ResourceUtil.GetImageList16();

            treeControlAdapter = new TreeControlAdapter(treeControl);

            treeControl.PreviewKeyDown += treeControl_PreviewKeyDown;
            treeControl.NodeExpandedChanging += treeControl_NodeExpandedChanging;
            treeControl.NodeExpandedChanged += treeControl_NodeExpandedChanged;

 
            m_searchInput = new StringSearchInputUI();
            m_searchInput.Updated += UpdateFiltering;

            m_control = new UserControl();
            m_control.Dock = DockStyle.Fill;
            m_control.SuspendLayout();
            m_control.Name = "Tree View".Localize();
            m_control.Text = "Tree View".Localize();
            m_control.Controls.Add(m_searchInput);
            m_control.Controls.Add(TreeControl);
            m_control.Layout += controls_Layout;
            m_control.ResumeLayout();
        }
开发者ID:GeertVL,项目名称:ATF,代码行数:35,代码来源:FilteredTreeControlEditor.cs

示例4: SetExecutionWindow

 public void SetExecutionWindow(UserControl control)
 {
     ExecutionPanel.Controls.Clear ();
     ExecutionPanel.Controls.Add (control);
     control.Dock = DockStyle.Fill;
     control.Select ();
 }
开发者ID:poobalan-arumugam,项目名称:stateproto,代码行数:7,代码来源:StateDiagramView.cs

示例5: NavigationTreePluginModule

 public NavigationTreePluginModule(
     IWindowHost windowHost,
     [Import("navigationMenu", typeof(UserControl))] NavigationTree navTree)
 {
     this.windowHost = windowHost;
     this.navTree = navTree;
 }
开发者ID:juristr,项目名称:codehacks,代码行数:7,代码来源:NavigationTreePluginModule.cs

示例6: refreshPanel

 public static void refreshPanel(UserControl control)
 {
     CurrentPage = control;
     CurrentPage.AutoSize = true;
     CurrentPage.Dock = DockStyle.Fill;
     //mainPanel.Refresh();
 }
开发者ID:openhbc,项目名称:openhbc,代码行数:7,代码来源:Login.cs

示例7: f_removeClient

 protected void f_removeClient(UserControl cv)
 {
     panel.SuspendLayout();
     panel.Controls.Remove(cv);
     panel.ResumeLayout();
     panel.Update();
 }
开发者ID:redviper,项目名称:l2pvpbot,代码行数:7,代码来源:BotView.cs

示例8: WizardPage

 public WizardPage(string text, UserControl userControl)
 {
   if (text == null || userControl == null)
     throw new ArgumentNullException();
   _userControl = userControl;
   _labelText = text;
 }
开发者ID:rnpowerconsulting,项目名称:appstract,代码行数:7,代码来源:WizardPage.cs

示例9: OnMouseMove

 public void OnMouseMove(UserControl canvas, MouseEventArgs e)
 {
     if (triangle == null || e.Button != MouseButtons.Left)
         return;
     triangle.EndPoint = e.Location;
     canvas.Refresh();
 }
开发者ID:tsiganoff,项目名称:PFSOFT_Test,代码行数:7,代码来源:ToolTriangle.cs

示例10: InitData

        //״̬�������������б��ʼ��
        public void InitData(string title, UCListType _uclType, UserControl _ucRetControl)
        {
            ucButtons.SetAckText("ˢ��");
            ucButtons.SetAckVisible(true);
            bValidSensor = false;
            CategoryIndex = -1;
            strTitle = title;
            uclType = _uclType;
            ucRetControl = _ucRetControl;
            InitPage();
            RefreshData();

            byte refresh = 0;
            switch (uclType)
            {
                case UCListType.UCLT_Status:
                    refresh = formFrame.configManage.cfg.paramFormWeight.RefreshStatus;
                    break;
                case UCListType.UCLT_Alarm:
                    refresh = formFrame.configManage.cfg.paramFormWeight.RefreshAlarm;
                    break;
                case UCListType.UCLT_Fault:
                    refresh = formFrame.configManage.cfg.paramFormWeight.RefreshFault;
                    break;
                default:
                    return;
            }
            RefreshControl(refresh);
        }
开发者ID:byteman,项目名称:multiheadscaler,代码行数:30,代码来源:UCList.cs

示例11: PaletteService

        public PaletteService(
            ICommandService commandService,
            IControlHostService controlHostService)
            : base(commandService)
        {
            m_controlHostService = controlHostService;

            m_searchInput = new StringSearchInputUI();
            m_searchInput.Updated += searchInput_Updated;

            m_control = new UserControl();
            m_control.Dock = DockStyle.Fill;
            m_control.SuspendLayout();
            m_control.Name = "Palette".Localize();
            m_control.Text = "Palette".Localize();
            m_control.Controls.Add(m_searchInput);
            m_control.Controls.Add(TreeControl);
            m_control.Layout += controls_Layout;
            m_control.ResumeLayout();

            m_controlHostService.RegisterControl(
                m_control,
                new ControlInfo(
                    "Palette".Localize(),
                    "Creates new instances".Localize(),
                    StandardControlGroup.Left, null,
                    "http://www.ship.scea.com/portal/search/search.action?q=PaletteService+or+Palette&context=resource_WIKI%7CWWSSDKATF".Localize()),
                this);

            m_paletteTreeAdapter = new PaletteTreeAdapter(this, m_searchInput);
        }
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:31,代码来源:PaletteService.cs

示例12: DisplayView

        private void DisplayView(Type type, ToolStripButton sender)
        {
            bool viewChanged = false;
            foreach (ToolStripItem item in tspMain.Items)
            {
                ToolStripButton button = item as ToolStripButton;
                if (button != null)
                {
                    if (button == sender)
                    {
                        viewChanged = (!button.Checked);
                    }
                    button.Checked = (button == sender);
                }
            }
            if (viewChanged)
            {
                // dispose of old control
                if (_control != null)
                {
                    pnlMain.Controls.Remove(_control);
                }

                // create new control
                _control = Activator.CreateInstance(type) as UserControl;
                pnlMain.Controls.Add(_control);
                _control.Dock = DockStyle.Fill;
            }
        }
开发者ID:yuzukwok,项目名称:TreeBeard,代码行数:29,代码来源:MainForm.cs

示例13: VSCodeEditorWindow

        public VSCodeEditorWindow(ServiceBroker sb, UserControl parent)
        {
            services = sb;
            coreEditor = new VSCodeEditor(parent.Handle, services);

            //Create window            
            IVsCodeWindow win = coreEditor.CodeWindow;
            cmdTarget = win as IOleCommandTarget;

            IVsTextView textView;
            int hr = win.GetPrimaryView(out textView);
            if (hr != VSConstants.S_OK)
                Marshal.ThrowExceptionForHR(hr);

            // assign the window handle
            IntPtr commandHwnd = textView.GetWindowHandle();
            AssignHandle(commandHwnd);

            //Register priority command target
            hr = services.VsRegisterPriorityCommandTarget.RegisterPriorityCommandTarget(
                0, (IOleCommandTarget)this, out cmdTargetCookie);

            if (hr != VSConstants.S_OK)
                Marshal.ThrowExceptionForHR(hr);

            //Add message filter
            Application.AddMessageFilter((System.Windows.Forms.IMessageFilter)this);
        }
开发者ID:elevate,项目名称:mysqlconnector-.net,代码行数:28,代码来源:VSCodeEditorWindow.cs

示例14: Form1

 public Form1(UserControl UC)
 {
     InitializeComponent();
     InitializeComponent();
     oUC = UC;
     this.Size = oUC.Size;
 }
开发者ID:Fucmeo,项目名称:ou-qlns,代码行数:7,代码来源:Popup.cs

示例15: LoadControl

 public void LoadControl(UserControl controlToLoad)
 {
     this.pContent.Controls.Clear();
     controlToLoad.Top = (this.pContent.Height - controlToLoad.Height) / 2;
     controlToLoad.Left = (this.pContent.Width - controlToLoad.Width) / 2;
     this.pContent.Controls.Add(controlToLoad);
 }
开发者ID:GNCPay,项目名称:virtualpos,代码行数:7,代码来源:frmMain.cs


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