System.Windows.Forms.Control.Invalidate()

Here are the examples of the csharp api System.Windows.Forms.Control.Invalidate() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1387 Examples 7

19 View Source File : LinedefInfoPanel.cs
License : GNU General Public License v3.0
Project Creator : anotak

public void ShowInfo(Linedef l)
		{
			TypeHandler th;
			bool upperunpegged, lowerunpegged;
			string peggedness;
            //double starttime = General.stopwatch.Elapsed.TotalMilliseconds;
            SuspendLayout();

			// Show/hide stuff depending on format
			if(!General.Map.FormatInterface.HasActionArgs)
			{
                if (bUsingArgsAlready || bNeedSetup)
                {
                    arglbl1.Visible = false;
                    arglbl2.Visible = false;
                    arglbl3.Visible = false;
                    arglbl4.Visible = false;
                    arglbl5.Visible = false;
                    arg1.Visible = false;
                    arg2.Visible = false;
                    arg3.Visible = false;
                    arg4.Visible = false;
                    arg5.Visible = false;

                    tableLayoutPanel1.ColumnStyles[1].Width = 0f;
                    infopanel.Width = doomformatwidth;
                    bUsingArgsAlready = false;
                }
            }
			else
			{
                if (!bUsingArgsAlready || bNeedSetup)
                {
                    arglbl1.Visible = true;
                    arglbl2.Visible = true;
                    arglbl3.Visible = true;
                    arglbl4.Visible = true;
                    arglbl5.Visible = true;
                    arg1.Visible = true;
                    arg2.Visible = true;
                    arg3.Visible = true;
                    arg4.Visible = true;
                    arg5.Visible = true;

                    tableLayoutPanel1.ColumnStyles[1].Width = 37.5f;
                    infopanel.Width = hexenformatwidth;
                    bUsingArgsAlready = true;
                }
            }

			// Move panels
			frontpanel.Left = infopanel.Left + infopanel.Width + infopanel.Margin.Right + frontpanel.Margin.Left;
			backpanel.Left = frontpanel.Left + frontpanel.Width + frontpanel.Margin.Right + backpanel.Margin.Left;
			
			// Get line action information
			LinedefActionInfo act = General.Map.Config.GetLinedefActionInfo(l.Action);
			
			// Determine peggedness
			upperunpegged = l.IsFlagSet(General.Map.Config.UpperUnpeggedFlag);
			lowerunpegged = l.IsFlagSet(General.Map.Config.LowerUnpeggedFlag);
			if(upperunpegged && lowerunpegged)
				peggedness = "Upper/Lower";
			else if(upperunpegged)
				peggedness = "Upper";
			else if(lowerunpegged)
				peggedness = "Lower";
			else
				peggedness = "None";

            // Linedef info
            sb.Length = 0;
            sb.Append(" Linedef ");
            sb.Append(l.Index);
            sb.Append(" ");
            infopanel.Text = sb.ToString();
            sb.Length = 0;
            action.Text = act.ToString();
			length.Text = l.Length.ToString("0.##");
            sb.Append(l.AngleDeg.ToString());
            sb.Append("\u00B0");
            angle.Text = sb.ToString();
            sb.Length = 0;
			tag.Text = l.Tag.ToString();
			unpegged.Text = peggedness;

            if (bUsingArgsAlready)
            {
                // Arguments
                sb.Append(act.Args[0].replacedle);
                sb.Append(':');
                arglbl1.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(act.Args[1].replacedle);
                sb.Append(':');
                arglbl2.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(act.Args[2].replacedle);
                sb.Append(':');
                arglbl3.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(act.Args[3].replacedle);
                sb.Append(':');
                arglbl4.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(act.Args[4].replacedle);
                sb.Append(':');
                arglbl5.Text = sb.ToString();
                sb.Length = 0;
                arglbl1.Enabled = act.Args[0].Used;
                arglbl2.Enabled = act.Args[1].Used;
                arglbl3.Enabled = act.Args[2].Used;
                arglbl4.Enabled = act.Args[3].Used;
                arglbl5.Enabled = act.Args[4].Used;
                arg1.Enabled = act.Args[0].Used;
                arg2.Enabled = act.Args[1].Used;
                arg3.Enabled = act.Args[2].Used;
                arg4.Enabled = act.Args[3].Used;
                arg5.Enabled = act.Args[4].Used;
                th = General.Types.GetArgumentHandler(act.Args[0]);
                th.SetValue(l.Args[0]); arg1.Text = th.GetStringValue();
                th = General.Types.GetArgumentHandler(act.Args[1]);
                th.SetValue(l.Args[1]); arg2.Text = th.GetStringValue();
                th = General.Types.GetArgumentHandler(act.Args[2]);
                th.SetValue(l.Args[2]); arg3.Text = th.GetStringValue();
                th = General.Types.GetArgumentHandler(act.Args[3]);
                th.SetValue(l.Args[3]); arg4.Text = th.GetStringValue();
                th = General.Types.GetArgumentHandler(act.Args[4]);
                th.SetValue(l.Args[4]); arg5.Text = th.GetStringValue();
            }

			// Front side available?
			if(l.Front != null)
			{
                // Show sidedef info
                sb.Append(" Front Sidedef ");
                sb.Append(l.Front.Index);
                sb.Append(' ');
                frontpanel.Text = sb.ToString();
                sb.Length = 0;
                sb.Append(" Sector ");
                sb.Append(l.Front.Sector.Index);
                frontsector.Text = sb.ToString();
                sb.Length = 0;
				frontsector.Visible = true;
                sb.Append(l.Front.OffsetX);
                sb.Append(", ");
                sb.Append(l.Front.OffsetY);
                frontoffset.Text = sb.ToString();
                sb.Length = 0;
				fronthighname.Text = l.Front.HighTexture;
				frontmidname.Text = l.Front.MiddleTexture;
				frontlowname.Text = l.Front.LowTexture;
				DisplaySidedefTexture(fronthightex, l.Front.HighTexture, l.Front.HighRequired());
				DisplaySidedefTexture(frontmidtex, l.Front.MiddleTexture, l.Front.MiddleRequired());
				DisplaySidedefTexture(frontlowtex, l.Front.LowTexture, l.Front.LowRequired());
				frontoffsetlabel.Enabled = true;
				frontoffset.Enabled = true;
				frontpanel.Enabled = true;
			}
			else
			{
                // Show no info
                frontpanel.Text = " Front Sidedef ";
                frontsector.Text = "";
                frontsector.Visible = false;
                frontoffsetlabel.Enabled = false;
                frontoffset.Enabled = false;
                frontpanel.Enabled = false;
                frontoffset.Text = "--, --";
                fronthighname.Text = "";
                frontmidname.Text = "";
                frontlowname.Text = "";
                fronthightex.BackgroundImage = null;
                frontmidtex.BackgroundImage = null;
                frontlowtex.BackgroundImage = null;
			}

			// Back size available?
			if(l.Back != null)
			{
                // Show sidedef info
                sb.Append(" Back Sidedef ");
                sb.Append(l.Back.Index);
                sb.Append(' ');
                backpanel.Text = sb.ToString();
                sb.Length = 0;

                sb.Append(" Sector ");
                sb.Append(l.Back.Sector.Index);
                backsector.Text = sb.ToString();
                sb.Length = 0;
				backsector.Visible = true;
                sb.Append(l.Back.OffsetX);
                sb.Append(", ");
                sb.Append(l.Back.OffsetY);
                backoffset.Text = sb.ToString();
                sb.Length = 0;
				backhighname.Text = l.Back.HighTexture;
				backmidname.Text = l.Back.MiddleTexture;
				backlowname.Text = l.Back.LowTexture;
				DisplaySidedefTexture(backhightex, l.Back.HighTexture, l.Back.HighRequired());
				DisplaySidedefTexture(backmidtex, l.Back.MiddleTexture, l.Back.MiddleRequired());
				DisplaySidedefTexture(backlowtex, l.Back.LowTexture, l.Back.LowRequired());
				backoffsetlabel.Enabled = true;
				backoffset.Enabled = true;
				backpanel.Enabled = true;
			}
			else
			{
                // Show no info
                backpanel.Text = " Back Sidedef ";
                backsector.Text = "";
                backsector.Visible = false;
                backoffsetlabel.Enabled = false;
                backoffset.Enabled = false;
                backpanel.Enabled = false;
                backoffset.Text = "--, --";
                backhighname.Text = "";
                backmidname.Text = "";
                backlowname.Text = "";
                backhightex.BackgroundImage = null;
                backmidtex.BackgroundImage = null;
                backlowtex.BackgroundImage = null;
			}
			
			// Position labels
			frontsector.Left = frontlowtex.Right - frontsector.Width;
			backsector.Left = backlowtex.Right - backsector.Width;
            ResumeLayout();
			// Show the whole thing
			this.Show();
            this.Invalidate();
            //this.Update(); // ano - don't think this is needed, and is slow

            bNeedSetup = false;

            //Logger.WriteLogLine((General.stopwatch.Elapsed.TotalMilliseconds - starttime) + " milliseconds for linedefinfopanel.showinfo");
        }

19 View Source File : FocusControl.cs
License : GNU General Public License v3.0
Project Creator : aurelitec

protected override void OnLeave(EventArgs e)
        {
            base.OnLeave(e);
            FocusControl.Current = null;
            this.Invalidate();
        }

19 View Source File : PlotControl.cs
License : MIT License
Project Creator : AlexGyver

public void HideZoomRectangle()
        {
            zoomRectangle = Rectangle.Empty;
            Invalidate();
        }

19 View Source File : SnippingTool.cs
License : Apache License 2.0
Project Creator : AnkiUniversal

protected override void OnMouseMove(MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
                return;
           
            int x1 = Math.Min(e.X, pointStart.X);
            int y1 = Math.Min(e.Y, pointStart.Y);
            int x2 = Math.Max(e.X, pointStart.X);
            int y2 = Math.Max(e.Y, pointStart.Y);
            rectSelection = new Rectangle(x1, y1, x2 - x1, y2 - y1);
            Invalidate();
        }

19 View Source File : TagDisplayControl.cs
License : MIT License
Project Creator : AlturosDestinations

public void SetTags(params string[] tags)
        {
            this.Tags = tags;
            this.Invalidate();
        }

19 View Source File : TreeViewAdv.cs
License : MIT License
Project Creator : AlexGyver

internal void SetIsExpanded(TreeNodeAdv node, bool value)
		{
			if (Root == node && !value)
				return; //Can't collapse root node

			if (value)
			{
				OnExpanding(node);
				node.OnExpanding();
			}
			else
			{
				OnCollapsing(node);
				node.OnCollapsing();
			}

			if (value && !node.IsExpandedOnce)
			{
				if (AsyncExpanding && LoadOnDemand)
				{
					AddExpandingNode(node);
					node.replacedignIsExpanded(true);
					Invalidate();
				}
				ReadChilds(node, AsyncExpanding);
				RemoveExpandingNode(node);
			}
			node.replacedignIsExpanded(value);
			SmartFullUpdate();

			if (value)
			{
				OnExpanded(node);
				node.OnExpanded();
			}
			else
			{
				OnCollapsed(node);
				node.OnCollapsed();
			}
		}

19 View Source File : KpiPlot.cs
License : GNU General Public License v3.0
Project Creator : architecture-building-systems

public void Clicked(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            OnClicked?.Invoke(this, e);
            sender.Invalidate();
        }

19 View Source File : TabBar.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

private void docManager_ActiveDoreplacedentChanged(object sender, DoreplacedentEventArgs e)
		{
			foreach (Tab tab in tabs)
			{
				if (tab.Doreplacedent == docManager.ActiveDoreplacedent)
				{
					activeTab = tab;
					break;
				}
			}
			this.Invalidate();
		}

19 View Source File : Balloon.cs
License : MIT License
Project Creator : azist

private void rebuild()
        {
          Invalidate();//Vista fix

           m_CurrentBodyRect = m_BodyRect;

           int left = m_BodyRect.Left < m_TargetPoint.X ? m_BodyRect.Left : m_TargetPoint.X;
           int top = m_BodyRect.Top < m_TargetPoint.Y ? m_BodyRect.Top : m_TargetPoint.Y;

           int right = m_BodyRect.Right > m_TargetPoint.X ? m_BodyRect.Right : m_TargetPoint.X;
           int bottom = m_BodyRect.Bottom > m_TargetPoint.Y ? m_BodyRect.Bottom : m_TargetPoint.Y;

           left-=BORDER_MARGIN;
           top-=BORDER_MARGIN;
           right+=BORDER_MARGIN;
           bottom+=BORDER_MARGIN;


           SetBounds(left, top, right - left, bottom - top);

           Color mask = Color.FromArgb(127, 127, 127);//VISTA BUG FIX, all components MUST be equal

           base.TransparencyKey = mask;
           base.BackColor = mask;
        }

19 View Source File : TabBar.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

private void docManager_DoreplacedentMoved(object sender, DoreplacedentMovedEventArgs e)
		{
			Tab tab = tabs[e.OldPostion];

			if (e.NewPosition > e.OldPostion)
			{
				for (int i = e.OldPostion; i < e.NewPosition; i++)
					tabs[i] = tabs[i + 1];
			}
			else // e.NewPosition < e.OldPostion
			{
				for (int i = e.OldPostion; i > e.NewPosition; i--)
					tabs[i] = tabs[i - 1];
			}
			tabs[e.NewPosition] = tab;
			Invalidate();
		}

19 View Source File : StatusContainer.cs
License : Apache License 2.0
Project Creator : AmpScm

internal void ApplySizes(StatusPanel first)
        {
            int i = 0;
            Size clSize = ClientSize;
            foreach (StatusPanel panel in Controls)
            {
                if (first != null && first != panel)
                    continue;
                else
                    first = null;

                if (!panel.Visible)
                    continue;

                panel.PanelLocation = new Point(0, i);
                int height = panel.PanelSize.Height;
                panel.PanelSize = new Size(clSize.Width - 2, height);

                i += height + 1 + PanelSpace;
            }

            this.AutoScrollMinSize = new Size(Width - SystemInformation.VerticalScrollBarWidth - 2, i + 1);
            Invalidate();
        }

19 View Source File : DiffOverview.cs
License : Apache License 2.0
Project Creator : AmpScm

private void DiffView_SizeChanged(object sender, EventArgs e)
        {
            //If the DiffView size changed, then our view window
            //may be longer or shorter, but the rendered image is
            //still valid.  So we just need to recalc the view rect
            //and invalidate the whole window.
            CalculateViewRect();
            Invalidate();
        }

19 View Source File : SplitContainerAdv.cs
License : MIT License
Project Creator : AlexGyver

protected override void OnMouseMove(MouseEventArgs e) {
      if (base.IsSplitterFixed) {
        if (e.Button == MouseButtons.Left) {
          if (Orientation == Orientation.Vertical) {
            if (e.X > 0 && e.X < Width) {
              SplitterDistance = e.X + delta < 0 ? 0 : e.X + delta;
            }
          } else {
            if (e.Y > 0 && e.Y < Height) {
              SplitterDistance = e.Y + delta < 0 ? 0 : e.Y + delta;
            }
          }
        } else {
          base.IsSplitterFixed = false;
        }
        Invalidate();
      } else {
        if (SplitterRectangle.Contains(e.Location)) {
          Cursor = Orientation == Orientation.Vertical ?
            Cursors.VSplit : Cursors.HSplit;
        }
      }
    }

19 View Source File : DockersTabsControl.cs
License : GNU General Public License v3.0
Project Creator : anotak

protected override void OnMouseLeave(EventArgs e)
		{
			if(VisualStyleInformation.IsSupportedByOS && VisualStyleInformation.IsEnabledByUser)
			{
				// Redraw?
				if(highlighttab != -1)
				{
					highlighttab = -1;
					this.Invalidate();
				}
			}
			
			base.OnMouseLeave(e);
		}

19 View Source File : DiagramNavigator.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

private void visualizer_VisibleAreaChanged(object sender, EventArgs e)
		{
			this.Invalidate(); //TODO: ezt lehetne tán optimalizálni, hogy ne hívja meg annyiszor...
		}

19 View Source File : ColorSetupForm.cs
License : MIT License
Project Creator : ar1st0crat

private void _color_MouseClick(object sender, MouseEventArgs e)
        {
            var colorDialog = new ColorDialog();
            if (colorDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var panel = sender as Panel;
            Colors[(int)panel.Tag] = colorDialog.Color;
            panel.BackColor = colorDialog.Color;
            Invalidate();
        }

19 View Source File : PlotControl.cs
License : MIT License
Project Creator : AlexGyver

public void Refresh(bool refreshData)
        {
            if (refreshData)
                Model.UpdateData();
            Invalidate();
        }

19 View Source File : HideTabControlBorders.cs
License : GNU General Public License v3.0
Project Creator : ASCOMInitiative

void TabControl_Selected(object sender, TabControlEventArgs e)
        {
            tabControl.Invalidate();
        }

19 View Source File : Canvas.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

private void doreplacedent_NeedsRedraw(object sender, EventArgs e)
		{
			Invalidate();
			OnDoreplacedentRedrawed(EventArgs.Empty);
		}

19 View Source File : PreviewForm.cs
License : MIT License
Project Creator : awaescher

public void InvalidatePreview()
		{
			if (IsDisposed)
				return;

			if (!AllowUpdates)
				return;

			if (Preview == null)
			{
				Hide();
			}
			else
			{
				var preferredSize = Preview.PreferredSize;
				if (preferredSize != Size)
					Size = preferredSize;
			}

			Opacity = PreviewOpacityController?.Opacity ?? 0.8;
			TransparencyKey = PreviewOpacityController?.TransparencyKey ?? Color.Empty;
			Invalidate();
		}

19 View Source File : Plot.cs
License : MIT License
Project Creator : AlexGyver

public void InvalidatePlot(bool updateData)
        {
            lock (this.invalidateLock)
            {
                this.isModelInvalidated = true;
                this.updateDataFlag = this.updateDataFlag || updateData;
            }

            this.Invalidate();
        }

19 View Source File : Plot.cs
License : MIT License
Project Creator : AlexGyver

public void ShowZoomRectangle(OxyRect r)
        {
            this.zoomRectangle = new Rectangle((int)r.Left, (int)r.Top, (int)r.Width, (int)r.Height);
            this.Invalidate();
        }

19 View Source File : Canvas.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

private void UpdateDoreplacedentOffset()
		{
			if (HasDoreplacedent)
			{
				Doreplacedent.Offset = this.Offset;
				if (MonoHelper.IsRunningOnMono)
					Invalidate();
			}
		}

19 View Source File : DiffOverview.cs
License : Apache License 2.0
Project Creator : AmpScm

private void UpdateAll()
        {
            RenderImage();
            CalculateViewRect();
            Invalidate();
        }

19 View Source File : TabBar.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

protected override void OnMouseMove(MouseEventArgs e)
		{
			base.OnMouseMove(e);

			if (e.Button == MouseButtons.Left && grabbedTab != null)
			{
				MoveTab(grabbedTab, e.Location);
			}

			bool overClosingSign = IsOverClosingSign(e.Location);
			if (activeCloseButton != overClosingSign)
			{
				activeCloseButton = overClosingSign;
				Invalidate();
			}
		}

19 View Source File : AnnotateMarginControl.cs
License : Apache License 2.0
Project Creator : AmpScm

protected override void OnMouseClick(MouseEventArgs e)
        {
            base.OnMouseClick(e);

            DoMove(e);

            AnnotateRegion section = GetSection(e.Location);

            if (section == null)
                _control.SetSelection(null);
            else
                _control.SetSelection(section.Source);

            Invalidate();

            if (e.Button == MouseButtons.Right)
                ShowContextMenu();
        }

19 View Source File : DiffOverview.cs
License : Apache License 2.0
Project Creator : AmpScm

private void DiffOptionsChanged(object sender, EventArgs e)
        {
            //The diff colors changed, so we need to rerender the
            //image.  The current view rect should still be valid.
            RenderImage();
            Invalidate();
        }

19 View Source File : SplitContainerAdv.cs
License : MIT License
Project Creator : AlexGyver

protected override void OnKeyDown(KeyEventArgs e) {
      if (!base.IsSplitterFixed) {
        if (e.KeyData == Keys.Right || e.KeyData == Keys.Down) {
          SplitterDistance += SplitterIncrement;
        } else if (e.KeyData == Keys.Left || e.KeyData == Keys.Up) {
          SplitterDistance -= SplitterIncrement;
        }
        Invalidate();
      }
    }

19 View Source File : SnippingTool.cs
License : Apache License 2.0
Project Creator : AnkiUniversal

protected override void OnMouseDown(MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
                return;
       
            pointStart = e.Location;
            rectSelection = new Rectangle(e.Location, new Size(0, 0));
            Invalidate();
        }

19 View Source File : DiagramNavigator.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

private void visualizer_DoreplacedentRedrawed(object sender, EventArgs e)
		{
			this.Invalidate();
		}

19 View Source File : DockersTabsControl.cs
License : GNU General Public License v3.0
Project Creator : anotak

protected override void OnMouseMove(MouseEventArgs e)
		{
			if(VisualStyleInformation.IsSupportedByOS && VisualStyleInformation.IsEnabledByUser)
			{
				int foundindex = -1;
				Rectangle prect = new Rectangle(e.Location, Size.Empty);
				
				// Check in which tab the mouse is
				for(int i = this.TabPages.Count - 1; i >= 0; i--)
				{
					Rectangle tabrect = this.GetTabRect(i);
					tabrect.Inflate(1, 1);
					if(tabrect.IntersectsWith(prect))
					{
						foundindex = i;
						break;
					}
				}
				
				// Redraw?
				if(foundindex != highlighttab)
				{
					highlighttab = foundindex;
					this.Invalidate();
				}
			}
			
			base.OnMouseMove(e);
		}

19 View Source File : TreeViewAdv.cs
License : MIT License
Project Creator : AlexGyver

public void AbortBackgroundExpandingThreads()
		{
			_threadPool.CancelAll(true);
			for (int i = 0; i < _expandingNodes.Count; i++)
				_expandingNodes[i].IsExpandingNow = false;
			_expandingNodes.Clear();
			Invalidate();
		}

19 View Source File : AngleControl.cs
License : GNU General Public License v3.0
Project Creator : anotak

private void SetAngle(int newangle, bool changebuttons)
		{
			bool changed;
			
			// Normalize and apply angle
			changed = (newangle != angle);
			angle = newangle;
			
			// Check if it matches an angle from the buttons
			if(changebuttons)
			{
				settingangle = true;
				for(int i = 0; i < 8; i++)
					buttons[i].Checked = (angle == i * 45);
				settingangle = false;
			}
			
			// Redraw
			this.Invalidate();
			
			// Raise event
			if((ValueChanged != null) && changed) ValueChanged(this, EventArgs.Empty);
		}

19 View Source File : Control.cs
License : Mozilla Public License 2.0
Project Creator : ahyahy

public virtual void EndUpdate()
        {
            SendMessage(M_Control.Handle, 11, -1, 0);
            M_Control.Invalidate();
            System.Windows.Forms.Application.DoEvents();
        }

19 View Source File : ColorSetupForm.cs
License : MIT License
Project Creator : ar1st0crat

private void _colorPanel_MouseClick(object sender, MouseEventArgs e)
        {
            var colorDialog = new ColorDialog();
            if (colorDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            
            var position = (float)e.X / _colorPanel.Width;
            
            var idx = ~Positions.BinarySearch(position);
            
            // wow, can it really happen?! ))
            if (idx < 0)
            {
                idx = ~idx;
            }

            Positions.Insert(idx, position);
            Colors.Insert(idx, colorDialog.Color);

            var panel = new Panel()
            {
                BorderStyle = BorderStyle.FixedSingle,
                BackColor = colorDialog.Color,
                Left = e.X + _colorPanel.Left,
                Top = _color1.Top,
                Width = _color1.Width,
                Height = _color1.Height,
                Tag = 1
            };
            panel.MouseClick += _color_MouseClick;
            Controls.Add(panel);

            _panels.Insert(idx, panel);

            for (var i = 0; i < _panels.Count; i++)
            {
                _panels[i].Tag = i;
            }

            Invalidate();
        }

19 View Source File : PlotControl.cs
License : MIT License
Project Creator : AlexGyver

protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);
            Invalidate();
        }

19 View Source File : DataGridViewCalendarCell.cs
License : MIT License
Project Creator : arasplm

public void Update(Rectangle cellBounds, bool displayed, bool isHeaderCell)
		{
			clearButton.Visible = displayed;
			if (!displayed)
			{
				return;
			}
			if (!this.IsInEditMode && this.Value != null && !string.IsNullOrEmpty(this.Value.ToString()) && (isFileToAras || isHeaderCell))
			{
				clearButton.Visible = true;
				clearButton.Parent = this.DataGridView;
				clearButton.Top = cellBounds.Top;
				clearButton.Left = cellBounds.Right - clearButton.Width;
				clearButton.Height = Math.Min(cellBounds.Height, 20);
			}
			else
			{
				clearButton.Visible = false;
			}

			clearButton.Invalidate();
			clearButton.Refresh();

			if (ctl != null)
			{
				ctl.Invalidate();
				ctl.Refresh();
			}
		}

19 View Source File : Canvas.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

private void doreplacedent_ZoomChanged(object sender, EventArgs e)
		{
			Invalidate();
			SetScrolls();
			OnZoomChanged(EventArgs.Empty);
			OnVisibleAreaChanged(EventArgs.Empty);
		}

19 View Source File : PositionGrid.cs
License : GNU General Public License v3.0
Project Creator : ArduinoIoTDev

private void OnMouseDown(object sender, MouseEventArgs e)
        {
            Pos_X = e.X - 100;
            Pos_Y = e.Y - 100;

            this.Invalidate();

            if (ChangeNotifyEvent != null)
                ChangeNotifyEvent(Pos_X, Pos_Y);
        }

19 View Source File : PlotControl.cs
License : MIT License
Project Creator : AlexGyver

public void ShowZoomRectangle(OxyRect r)
        {
            zoomRectangle = new Rectangle((int)r.Left, (int)r.Top, (int)r.Width, (int)r.Height);
            Invalidate();
        }

19 View Source File : FocusControl.cs
License : GNU General Public License v3.0
Project Creator : aurelitec

protected override void OnEnter(EventArgs e)
        {
            base.OnEnter(e);
            FocusControl.Current = this;

            // Bring the control to the front of the z-order
            this.BringToFront();

            // Redraw the control
            this.Invalidate();
        }

19 View Source File : DirectionalityOptions.cs
License : MIT License
Project Creator : a1xd

private void DrawShown()
        {
            ContainingPanel.Height = OpenHeight;
            ContainingPanel.Invalidate();
        }

19 View Source File : SimpleProgressBar.cs
License : MIT License
Project Creator : AutoItConsulting

protected override void OnResize(EventArgs e)
        {
            // Invalidate the control to get a repaint.
            Invalidate();
        }

19 View Source File : Plot.cs
License : MIT License
Project Creator : AlexGyver

public void HideZoomRectangle()
        {
            this.zoomRectangle = Rectangle.Empty;
            this.Invalidate();
        }

19 View Source File : TabBar.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

private void docManager_DoreplacedentRemoved(object sender, DoreplacedentEventArgs e)
		{
			for (int index = 0; index < tabs.Count; index++)
			{
				if (tabs[index].Doreplacedent == e.Doreplacedent)
				{
					tabs.RemoveAt(index);
					this.Invalidate();
					return;
				}
			}
		}

19 View Source File : DirectionalityOptions.cs
License : MIT License
Project Creator : a1xd

private void DrawHidden()
        {
            ContainingPanel.Height = ClosedHeight;
            ContainingPanel.Invalidate();
        }

19 View Source File : Control.cs
License : Mozilla Public License 2.0
Project Creator : ahyahy

public void Invalidate()
        {
            M_Control.Invalidate();
        }

19 View Source File : Canvas.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

protected virtual void OnMouseHWheel(EventArgs e) //TODO: MouseEventArgs kellene
		{
			UpdateDoreplacedentOffset();
			Invalidate(); //TODO: SetDisplayRectLocation() kellene
			if (MouseHWheel != null)
				MouseHWheel(this, e);
		}

19 View Source File : TabBar.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

protected override void OnMouseLeave(EventArgs e)
		{
			base.OnMouseLeave(e);

			if (activeCloseButton)
			{
				activeCloseButton = false;
				Invalidate();
			}
		}

19 View Source File : AnnotateMarginControl.cs
License : Apache License 2.0
Project Creator : AmpScm

protected override void OnSizeChanged(EventArgs e)
        {
            base.OnSizeChanged(e);

            if (!DesignMode)
                Invalidate();
        }

See More Examples