當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。