protected override void OnControlRemoved(ControlEventArgs e)
 {
     base.OnControlRemoved(e);
     if (_previewHandler != null)
     {
         _previewHandler.Unload();
         _previewHandler = null;
     }
 }
Пример #2
0
        private void TabPage_ControlAdded(object sender, ControlEventArgs e)
        {

            TabPage tab = sender as TabPage;
            RaiseLoadedEvent(tab);

        }
Пример #3
0
 protected override void OnControlAdded(ControlEventArgs e)
 {
     var tabPage = e.Control as TabPage;
     if (tabPage != null)
         tabPage.BackColor = Color.White;
     base.OnControlAdded(e);
 }
Пример #4
0
        private void pAccounts_ControlRemoved(object sender, ControlEventArgs e)
        {
            System.Windows.Forms.Control.ControlCollection allAccounts = pAccounts.Controls;

            foreach (Control control in allAccounts)
            {
                ((AccountListItem)control).cbTransferToAccount.Items.Clear();
                ((AccountListItem)control).cbTransferToAccount.Items.Add("");
            }

            int position = 0;

            foreach (Control control in allAccounts)
            {
                AccountListItem accountDetailsControl = (AccountListItem)control;
                control.Location = new Point(0, position);
                foreach (Control control1 in allAccounts)
                {
                    AccountListItem accountDetailsControl1 = (AccountListItem)control1;
                    if (!accountDetailsControl1.Equals(accountDetailsControl))
                    {
                        accountDetailsControl1.Invoke((Action)(delegate
                        {
                            accountDetailsControl1.cbTransferToAccount.Items.Add(accountDetailsControl.Account.Login);
                        }));
                        accountDetailsControl1.Refresh();
                    }
                }
                position += 22;
            }
        }
Пример #5
0
 void layoutControlUC_ControlAdded(object sender, ControlEventArgs e)
 {
     if (e.Control is IMainView)
     {
         (e.Control as IMainView).InitializeControls();
     }
 }
Пример #6
0
 /// <summary>
 /// Raises the ControlAdded event.
 /// </summary>
 /// <param name="e">A ControlEventArgs that contains the event data.</param>
 protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e)
 {
     base.OnControlAdded(e);
     BSE.Windows.Forms.XPanderPanel xpanderPanel = e.Control as BSE.Windows.Forms.XPanderPanel;
     if (xpanderPanel != null)
     {
         if (xpanderPanel.Expand == true)
         {
             foreach (XPanderPanel tmpXPanderPanel in this.XPanderPanels)
             {
                 if (tmpXPanderPanel != xpanderPanel)
                 {
                     tmpXPanderPanel.Expand = false;
                     tmpXPanderPanel.Height = xpanderPanel.CaptionHeight;
                 }
             }
         }
         xpanderPanel.Parent = this;
         xpanderPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
         xpanderPanel.Left  = this.Padding.Left;
         xpanderPanel.Width = this.ClientRectangle.Width
                              - this.Padding.Left
                              - this.Padding.Right;
         xpanderPanel.PanelStyle    = this.PanelStyle;
         xpanderPanel.ShowBorder    = this.ShowBorder;
         xpanderPanel.ColorScheme   = this.ColorScheme;
         xpanderPanel.Top           = this.GetTopPosition();
         xpanderPanel.CaptionClick += new EventHandler <XPanderPanelClickEventArgs>(this.XPanderPanelCaptionClick);
     }
     else
     {
         throw new InvalidOperationException("Can only add BSE.Windows.Forms.XPanderPanel");
     }
 }
 /// <summary>
 /// Raises the System.Windows.Forms.Control.ControlAdded event and hooks the MouseDown, MouseMove, and MouseUp events to the <see cref="ChildControlStartDrag"/>, <see cref="ChildControllDragging"/>, and <see cref="ChildControlStopDrag"/> event handlers respectively.
 /// </summary>
 /// <param name="e">An System.EventArgs that contains the event data.</param>
 protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e)
 {
     base.OnControlAdded(e);
     e.Control.MouseDown += new System.Windows.Forms.MouseEventHandler(ChildControlStartDrag);
     e.Control.MouseMove += new System.Windows.Forms.MouseEventHandler(ChildControlDragging);
     e.Control.MouseUp   += new MouseEventHandler(ChildControlStopDrag);
 }
Пример #8
0
        protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);

            if (!this.DesignMode)
            {
                if (e.Control != null)
                {
                    Control c = e.Control;
                    if (!(c is IHighlightControl))
                    {
                        //throw new Exception("Control needs to be an IHighlightControl");
                    }

                    c.Click += new EventHandler(c_Click);
                    if (c is IHighlightControl)
                    {
                        c.MouseMove += new MouseEventHandler(c_MouseMove);
                        c.MouseLeave += new EventHandler(c_MouseLeave);
                    }

                    int index = this.Controls.IndexOf(c);
                    Size s = c.Size;
                    c.Location = new Point(0, (s.Height * index) + (Offset.Height * index));
                }
            }
        }
Пример #9
0
 protected override void OnControlAdded(ControlEventArgs e) {
     base.OnControlAdded(e);
     if(e.Control is UserControl) {
         AcceptButton = Find(e.Control, (btn) => btn.Text == "OK");
         CancelButton = Find(e.Control, (btn) => btn.Text == "Cancel");
     }
 }
Пример #10
0
        protected override void OnControlRemoved(ControlEventArgs e)
        {
            if (current.Equals(e.Control.Name))
                current = String.Empty; 

            base.OnControlRemoved(e);
        }
Пример #11
0
 protected override void OnControlRemoved(ControlEventArgs e)
 {
     base.OnControlRemoved(e);
     if (isAccept)
     {
         PLMessageBoxExt.ShowNotificationMessage("Để nhận được kết quả sau khi cài bổ trợ.\nVui lòng khởi động lại chương trình.", true);
     }
 }
Пример #12
0
        private static void OnUIAHelpRequested(object sender, SWF.ControlEventArgs args)
        {
            SWF.HelpProvider helpProvider = (SWF.HelpProvider)sender;
            HelpProvider     provider
                = (HelpProvider)ProviderFactory.GetProvider(helpProvider);

            provider.Show(args.Control);
        }
Пример #13
0
        protected override void OnControlAdded(ControlEventArgs e)
        {
            e.Control.Dock = DockStyle.Fill;
            e.Control.Visible = false;
            //Current = e.Control.Name;   

            base.OnControlAdded(e);
        }
Пример #14
0
 /// <summary>
 /// Overriden. Raises the ControlRemoved event
 /// </summary>
 /// <param name="e">Additional event info</param>
 protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e)
 {
     base.OnControlRemoved(e);
     if (e.Control is NaviBand)
     {
         RemoveBand(e.Control as NaviBand);
     }
 }
 protected override void OnControlAdded(ControlEventArgs e)
 {
     base.OnControlAdded(e);
     NoBorderTabPage page = e.Control as NoBorderTabPage;
     if (page != null && !tabs.TabPages.Contains(page.Page)) {
         pages.Add(page);
     }
 }
Пример #16
0
 void flowLayoutPanel1_ControlRemoved(object sender, System.Windows.Forms.ControlEventArgs e)
 {
     if (this.flowLayoutPanel1.Controls.Count > 1)
     {
         this.flowLayoutPanel1.Controls[1].Anchor = AnchorStyles.None;
         this.flowLayoutPanel1.Controls[1].Size   = new System.Drawing.Size(flowLayoutPanel1.Width - pad, flowLayoutPanel1.Controls[1].Height);
     }
 }
		protected override void OnControlAdded(ControlEventArgs e) {

			if (e.Control is ControlPanelTaskLink) {
				(e.Control as ControlPanelTaskLink).NormalColor = _renderer.GetColor(ColorProperty.TextColor);
			}
			
			base.OnControlAdded(e);
		}
 protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e)
 {
     if (_DrawTabPage)
     {
         e.Control.Paint -= TabPage_Paint;
     }
     base.OnControlRemoved(e);
 }
Пример #19
0
		protected override void OnControlAdded(ControlEventArgs e)
		{
			base.OnControlAdded(e);
			if (Tools.IsRunningOnMono)
			{
				ApplyMonoStyle(e.Control);
			}
		}
Пример #20
0
        protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);

            var radioButton = e.Control as RadioButton;
            if (radioButton != null)
                radioButton.CheckedChanged += radioButton_CheckedChanged;
        }
Пример #21
0
 private void mainTabs_ControlRemoved(object sender, ControlEventArgs e)
 {
     if (e.Control is TabPage)
     {
         TabPage tabPage = e.Control as TabPage;
         tabPage.ControlAdded -= TabPage_ControlAdded;
     }
 }
Пример #22
0
 protected override void OnControlRemoved(ControlEventArgs e)
 {
     LockScreenWidget widget = e.Control as LockScreenWidget;
     if(widget != null)
     {
         widget.LockScreen = null;
     }
     base.OnControlRemoved(e);
 }
Пример #23
0
        /// <summary>
        /// Handler for drop event.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnControlAdded(ControlEventArgs e)
        {
            this.SetFont(e.Control, this._controlsFont);

            if (e.Control is NotenizerAdvancedLabel)
                (e.Control as NotenizerAdvancedLabel).ResetToolTip();

            base.OnControlAdded(e);
        }
Пример #24
0
 private void BaseList_ControlRemoved(object sender, System.Windows.Forms.ControlEventArgs e)
 {
     e.Control.Enter -= new EventHandler(handlesEnter);
     e.Control.Leave -= new EventHandler(handlesLeave);
     if (!_noUpdate)
     {
         this.Redraw();
     }
 }
Пример #25
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 protected override void OnControlAdded(ControlEventArgs e)
 {
     try
     {
         e.Control.BackColor = System.Drawing.Color.Transparent;
     }
     catch { }
     base.OnControlAdded(e);
 }
Пример #26
0
        protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);

            e.Control.GotFocus += new EventHandler(Control_GotFocus);
            e.Control.LostFocus += new EventHandler(Control_LostFocus);
            e.Control.MouseEnter += new EventHandler(Control_MouseEnter);
            e.Control.MouseLeave += new EventHandler(Control_MouseLeave);
        }
Пример #27
0
        private void mainTabs_ControlAdded(object sender, ControlEventArgs e)
        {
            if (e.Control is TabPage)
            {
                TabPage tabPage = e.Control as TabPage;
                tabPage.ControlAdded += TabPage_ControlAdded;

                RaiseLoadedEvent(tabPage);
            }
        }
Пример #28
0
        private void MenuContainer_ControlAdded(object sender, System.Windows.Forms.ControlEventArgs e)
        {
            int sum = 0;

            foreach (MenuButton c in this.items)
            {
                sum += 35;
            }
            this.Height = sum;
        }
Пример #29
0
        protected override void OnControlRemoved(ControlEventArgs e)
        {
            base.OnControlRemoved(e);

            if (e.Control is RadioButton)
            {
                RadioButton rb = (RadioButton)e.Control;
                rb.CheckedChanged += rb_CheckedChanged;
            }
        }
Пример #30
0
 private void splitContainer_Panel2_ControlAdded(object sender, ControlEventArgs e)
 {
     if (e.Control is SettingsPage)
     {
         var page = e.Control as SettingsPage;
         page.Dock = DockStyle.Fill;
         CurrentPage = page;
         CurrentNode = page.ParentNode;
     }
 }
Пример #31
0
 protected override void OnControlAdded(ControlEventArgs e)
 {
     LockScreenWidget widget = e.Control as LockScreenWidget;
     if(widget == null)
     {
         throw new InvalidOperationException("Only Widgets can be added to this container!");
     }
     widget.LockScreen = this;
     base.OnControlAdded(e);
 }
Пример #32
0
 private void BaseList_ControlAdded(object sender, System.Windows.Forms.ControlEventArgs e)
 {
     e.Control.Enter   += new EventHandler(handlesEnter);
     e.Control.Leave   += new EventHandler(handlesLeave);
     e.Control.TabIndex = this.Controls.IndexOf(e.Control);
     if (!_noUpdate)
     {
         this.Redraw();
     }
 }
 protected override void OnControlAdded(ControlEventArgs e)
 {
   base.OnControlAdded(e);
   string x = e.Control.GetType().ToString();
   Control ec = e.Control;
   if (ec.GetType() == typeof(ValueEditor))
   {
     ((ValueEditor)ec).TextBox.TextChanged += new EventHandler(ConditionPanelType_TextChanged);
   }
 }
        protected override void OnControlRemoved(ControlEventArgs e)
        {
            base.OnControlRemoved(e);

            if (Parent is GroupBox)
            {
                GroupBox gb = Parent as GroupBox;
                gb.Height -= e.Control.Height + 6;
            }
        }
Пример #35
0
        private void LayoutPanel_ControlAdded(object sender, System.Windows.Forms.ControlEventArgs e)
        {
            int width = 0;

            foreach (System.Windows.Forms.Control con in ((System.Windows.Forms.FlowLayoutPanel)sender).Controls)
            {
                width += con.Width;
            }
            ((System.Windows.Forms.FlowLayoutPanel)sender).Width = width;
        }
Пример #36
0
 protected override void OnControlAdded(ControlEventArgs e_)
 {
     base.OnControlAdded(e_);
     System.Windows.Forms.TabPage page = e_.Control as System.Windows.Forms.TabPage;
     if ((page != null) && (page.Parent == this) && (IsHandleCreated || Created))
     {
         InitializeTabPage(page, IsHandleCreated, Created);
     }
     Console.WriteLine("Tab Created!");
 }
Пример #37
0
 /// <summary>
 /// Overriden. Raises the ControlAdded event
 /// </summary>
 /// <param name="e">Additional event info</param>
 protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e)
 {
     base.OnControlAdded(e);
     if ((e.Control is NaviBand) &&
         !(e.Control is NaviBandCollapsed))
     {
         AddBand(e.Control as NaviBand);
         OnLayout(new LayoutEventArgs(this, "Bands"));
     }
 }
 protected override void OnControlAdded(ControlEventArgs e)
 {
     e.Control.Dock = DockStyle.Fill;
     if ((!this.IsLayoutSuspended() && (e.Control != this.FSelectedPage)) && e.Control.Enabled)
     {
         e.Control.SuspendLayout();
         e.Control.Enabled = false;
     }
     base.OnControlAdded(e);
 }
Пример #39
0
 protected override void OnControlAdded(ControlEventArgs e)
 {
     base.OnControlAdded(e);
     this.SelectedTab = e.Control as TabPage;
     for(int i=0;i<e.Control.Controls.Count;i++)
     {
         var item = e.Control.Controls[i];
         item.Dock = DockStyle.Fill;
     }
 }
Пример #40
0
 /// <summary>
 /// Add Mouse Event Handlers for each control added into the form,
 /// if Draggable property of the form is set to true and the control
 /// viewName is not in the ExcludeList.Exclude list is the comma separated
 /// list of the Controls for which you do not require the mouse handler 
 /// to be added. For Example a button.  
 /// </summary>
 /// <param name="e"></param>
 protected override void OnControlAdded(ControlEventArgs e)
 {
    if (this.Draggable && (this.ExcludeList.IndexOf(e.Control.Name) == -1))
     {
         e.Control.MouseDown += new MouseEventHandler(MainForm_MouseDown);
         e.Control.MouseUp += new MouseEventHandler(MainForm_MouseUp);
         e.Control.MouseMove += new MouseEventHandler(MainForm_MouseMove);
     }
     base.OnControlAdded(e);
 }
Пример #41
0
        private void HandleControlAdded(object sender, ControlEventArgs e)
        {

            if(e.Control is PluginTab)
            {
                var pluginTab = e.Control as PluginTab;

                pluginTab.LastTabControl = this;

            }
        }
Пример #42
0
        void Tab_ControlAdded(object sender, System.Windows.Forms.ControlEventArgs e)
        {
            int sumLength = 0;

            foreach (System.Windows.Forms.Control con in this.Controls)
            {
                sumLength += con.Width;
            }

            this.Width = sumLength;
        }
Пример #43
0
        protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlRemoved(e);

            JMComboBoxButton xpanderPanel = e.Control as JMComboBoxButton;

            if (xpanderPanel != null)
            {
                xpanderPanel.Click -= new EventHandler(xpanderPanel_Click);
            }
        }
Пример #44
0
        private static void OnUIAControlHookUp(object sender, SWF.ControlEventArgs args)
        {
            SWF.Control       control       = (SWF.Control)sender;
            SWF.ErrorProvider errorProvider = GetErrorProviderFromControl(control);

            if (control.Parent != null)
            {
                ErrorProvider.InstancesTracker.AddControl(args.Control,
                                                          control.Parent,
                                                          errorProvider);
            }
        }
Пример #45
0
        /// <summary>
        /// Raises the ControlRemoved event.
        /// </summary>
        /// <param name="e">A ControlEventArgs that contains the event data.</param>
        protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlRemoved(e);

            XPanderPanel xpanderPanel =
                e.Control as XPanderPanel;

            if (xpanderPanel != null)
            {
                xpanderPanel.CaptionClick -= new EventHandler <XPanderPanelClickEventArgs>(this.XPanderPanelCaptionClick);
            }
        }
Пример #46
0
        protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlRemoved(e);

            JPictureBox xpanderPanel = e.Control as JPictureBox;

            if (xpanderPanel != null)
            {
                xpanderPanel.DeleteClick -= new EventHandler(xpanderPanel_DeleteClick);
                xpanderPanel.SelectClick -= new EventHandler(xpanderPanel_SelectClick);
            }
            OnResize(EventArgs.Empty);
        }
Пример #47
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlRemoved(e);

            DockWindow window = e.Control as DockWindow;

            if (window.TabStripItem == this.boldedItem)
            {
                this.boldedItem = null;
            }

            UpdateView();
        }
Пример #48
0
 protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e)
 {
     if (!(e.Control is ManagedPanel))
     {
         throw new ArgumentException("Only Mangel.ManagedPanels can be added to a Mangel.PanelManger.");
     }
     if ((this.SelectedPanel != null))
     {
         ((ManagedPanel)this.SelectedPanel).Visible = false;
     }
     this.SelectedPanel = (ManagedPanel)e.Control;
     e.Control.Visible  = true;
     base.OnControlAdded(e);
 }
Пример #49
0
        /// <summary>
        /// Raises the ControlRemoved event.
        /// </summary>
        /// <param name="e">A ControlEventArgs that contains the event data.</param>
        protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlRemoved(e);

            BSE.Windows.Forms.XPanderPanel xpanderPanel =
                e.Control as BSE.Windows.Forms.XPanderPanel;

            if (xpanderPanel != null)
            {
                xpanderPanel.PanelStyleChanged -= new EventHandler <PanelStyleChangeEventArgs>(XpanderPanelPanelStyleChanged);
                xpanderPanel.ExpandClick       -= new EventHandler <EventArgs>(this.XPanderPanelExpandClick);
                xpanderPanel.CloseClick        -= new EventHandler <EventArgs>(this.XPanderPanelCloseClick);
            }
        }
Пример #50
0
        protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlRemoved(e);

            ExpondPanel expondPanel =
                e.Control as ExpondPanel;

            if (expondPanel != null)
            {
                expondPanel.PanelStyleChanged -= new EventHandler <PanelStyleChangeEventArgs>(ExpondPanelPanelStyleChanged);
                expondPanel.ExpandClick       -= new EventHandler <EventArgs>(this.ExpondPanelExpandClick);
                expondPanel.CloseClick        -= new EventHandler <EventArgs>(this.ExpondPanelCloseClick);
            }
        }
Пример #51
0
 protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e)
 {
     if (!(e.Control is ManagedPanel))
     {
         return;
     }
     if (this.ManagedPanels.Count > 0)
     {
         this.SelectedIndex = 0;
     }
     else
     {
         this.SelectedPanel = null;
     }
     base.OnControlRemoved(e);
 }
Пример #52
0
        protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlAdded(e);
            ExpondPanel expondPanel = e.Control as ExpondPanel;

            if (expondPanel != null)
            {
                if (expondPanel.Expand == true)
                {
                    foreach (ExpondPanel tmpExpondPanel in this.ExpondPanels)
                    {
                        if (tmpExpondPanel != expondPanel)
                        {
                            tmpExpondPanel.Expand = false;
                            tmpExpondPanel.Height = expondPanel.CaptionHeight;
                        }
                    }
                }
                expondPanel.Parent = this;
                expondPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                           | System.Windows.Forms.AnchorStyles.Right)));
                expondPanel.Left  = this.Padding.Left;
                expondPanel.Width = this.ClientRectangle.Width
                                    - this.Padding.Left
                                    - this.Padding.Right;
                expondPanel.PanelStyle  = this.PanelStyle;
                expondPanel.ColorScheme = this.ColorScheme;
                if (this.PanelColors != null)
                {
                    expondPanel.SetPanelProperties(this.PanelColors);
                }
                expondPanel.ShowBorder         = this.ShowBorder;
                expondPanel.ShowCloseIcon      = this._isShowCloseIcon;
                expondPanel.ShowExpandIcon     = this._isShowExpandIcon;
                expondPanel.CaptionStyle       = this._captionStyle;
                expondPanel.Top                = this.GetTopPosition();
                expondPanel.PanelStyleChanged += new EventHandler <PanelStyleChangeEventArgs>(ExpondPanelPanelStyleChanged);
                expondPanel.ExpandClick       += new EventHandler <EventArgs>(this.ExpondPanelExpandClick);
                expondPanel.CloseClick        += new EventHandler <EventArgs>(this.ExpondPanelCloseClick);
            }
            else
            {
                throw new InvalidOperationException("Can only add ExpondPanel");
            }
        }
Пример #53
0
        protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlAdded(e);
            JPictureBox xpanderPanel = e.Control as JPictureBox;

            if (xpanderPanel != null)
            {
                xpanderPanel.Parent = this;
                xpanderPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                            | System.Windows.Forms.AnchorStyles.Right)));
                xpanderPanel.Width        = (Width - this.Padding.Left - this.Padding.Right - 6) / _ZCount;
                xpanderPanel.Height       = _ZHeight;
                xpanderPanel.Location     = this.GetTopPosition(0);
                xpanderPanel.DeleteClick += new EventHandler(xpanderPanel_DeleteClick);
                xpanderPanel.SelectClick += new EventHandler(xpanderPanel_SelectClick);
            }
            else
            {
                throw new InvalidOperationException("只能添加JPictureBox对象");
            }
        }
Пример #54
0
        private static void OnUIAErrorProviderUnhookUp(object sender, SWF.ControlEventArgs args)
        {
            SWF.ErrorProvider errorProvider = (SWF.ErrorProvider)sender;
            List <Control>    list          = null;

            if (errorProviders.TryGetValue(errorProvider, out list) == true)
            {
                list.Remove(args.Control);
                if (list.Count == 0)
                {
                    errorProviders.Remove(errorProvider);
                }

                //Let's disassociate ErrorProvider if Provider for Control already exists
                FragmentControlProvider provider =
                    (FragmentControlProvider)ProviderFactory.FindProvider(args.Control);
                if (provider != null)
                {
                    provider.ErrorProvider = null;
                }
            }
        }
Пример #55
0
        protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlAdded(e);
            JMComboBoxButton xpanderPanel = e.Control as JMComboBoxButton;

            if (xpanderPanel != null)
            {
                xpanderPanel.Parent = this;
                xpanderPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                            | System.Windows.Forms.AnchorStyles.Right)));
                xpanderPanel.Left  = this.Padding.Left;
                xpanderPanel.Width = this.ClientRectangle.Width - ScrollWidth
                                     - this.Padding.Left
                                     - this.Padding.Right;

                xpanderPanel.Top    = this.GetTopPosition();
                xpanderPanel.Click += new EventHandler(xpanderPanel_Click);
            }
            else
            {
                throw new InvalidOperationException("只能添加JMComboBoxButton对象");
            }
        }
Пример #56
0
        private static void OnUIAErrorProviderHookUp(object sender, SWF.ControlEventArgs args)
        {
            SWF.ErrorProvider errorProvider = (SWF.ErrorProvider)sender;
            List <Control>    list          = null;

            if (errorProviders.TryGetValue(errorProvider, out list) == false)
            {
                list = new List <Control> ();
                errorProviders [errorProvider] = list;
            }
            if (list.Contains(args.Control) == false)
            {
                list.Add(args.Control);
            }

            //Let's associate ErrorProvider if Provider for Control already exists
            FragmentControlProvider provider =
                (FragmentControlProvider)ProviderFactory.FindProvider(args.Control);

            if (provider != null)
            {
                provider.ErrorProvider = errorProvider;
            }
        }
Пример #57
0
 private void OnControlRemoved(object sender, SWF.ControlEventArgs args)
 {
     HandleComponentRemoved(args.Control);
 }
Пример #58
0
 private void Control_Removed(object sender, System.Windows.Forms.ControlEventArgs e)
 {
     MessageBox.Show("The control named " + e.Control.Name + " has been removed from the form.");
 }
Пример #59
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e)
        {
            base.OnControlAdded(e);

            UpdateView();
        }
Пример #60
0
 /// <summary>
 /// 添加控件时,设置事件处理
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void Ctrl_ControlAdded(object sender, System.Windows.Forms.ControlEventArgs e)
 {
     // 为控件添加输入法处理,即调用 AddImeHandler 方法
     AddImeHandler(e.Control);
 }