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


C# Panel.Invalidate方法代码示例

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


在下文中一共展示了Panel.Invalidate方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: randomizeArray

 public static void randomizeArray(int[] array, Panel panel)
 {
     for (int i = 0; i < array.Length; i++)
     {
         array[i] = random.Next(10, 100);
     }
     panel.Invalidate();
 }
开发者ID:EbbeVang,项目名称:SortingAlgorithms,代码行数:8,代码来源:Sorting.cs

示例2: MouseMove

 public void MouseMove(ref EditorData data, Panel panel, Point gridPosition)
 {
     if (mouseDown&&!mPrevious.Equals(gridPosition))
     {
         data.SelectedEntities = data.Level.SelectEntities(mInitial, gridPosition, true);
         mPrevious = gridPosition;
         panel.Invalidate(panel.DisplayRectangle);
     }
 }
开发者ID:klegan711,项目名称:Gravity-Shift,代码行数:9,代码来源:MultiSelect.cs

示例3: MouseMove

 public void MouseMove(ref EditorData data, Panel panel, Point gridPosition)
 {
     if (!_mPrevious.Equals(gridPosition) && data.SelectedEntities.Count > 0 && _mouseDown)
     {
         //Keep an eye on this. The SelectedEntities can return an empty list
         data.Level.MoveEntity(data.SelectedEntities,
             new Size(Point.Subtract(gridPosition, new Size(_mPrevious))), false);
         _mPrevious = gridPosition;
         panel.Invalidate(panel.DisplayRectangle);
     }
 }
开发者ID:DizWARE,项目名称:Mr-Gravity,代码行数:11,代码来源:SingleSelect.cs

示例4: DrawWaterMark

 /// <summary>
 /// Draws the watermark if the text length is 0
 /// </summary>
 private void DrawWaterMark()
 {
     if (this.waterMarkContainer == null && this.TextLength <= 0)
     {
         waterMarkContainer = new Panel(); // Creates the new panel instance
         waterMarkContainer.Paint += new PaintEventHandler(waterMarkContainer_Paint);
         waterMarkContainer.Invalidate();
         waterMarkContainer.Click += new EventHandler(waterMarkContainer_Click);
         this.Controls.Add(waterMarkContainer); // adds the control
     }
 }
开发者ID:BruceNielsen,项目名称:_V4.7-Proxy,代码行数:14,代码来源:HintedTextBox.cs

示例5: MouseMove

 public void MouseMove(ref EditorData data, Panel panel, Point gridPosition)
 {
     if (data.OnDeck == null || !data.OnDeck.Paintable) return;
     if (data.Level.SelectEntity(gridPosition) == null && _mPainting && !_mPrevious.Equals(gridPosition))
     {
         var entity = data.OnDeck.Copy();
         entity.Location = gridPosition;
         data.Level.AddEntity(entity, gridPosition, true);
         data.SelectedEntities.Clear();
         data.SelectedEntities.Add(entity);
         _mPrevious = gridPosition;
         panel.Invalidate(panel.DisplayRectangle);
     }
 }
开发者ID:DizWARE,项目名称:Mr-Gravity,代码行数:14,代码来源:PaintEntity.cs

示例6: MouseMove

        public void MouseMove(ref EditorData data, Panel panel, Point gridPosition)
        {
            var topEntity = new ArrayList();
            var entity = data.Level.SelectEntity(gridPosition);

            if (entity != null && _mPainting && !_mPrevious.Equals(gridPosition))
                try
                {
                    data.SelectedEntities.Clear();
                    topEntity.Add(entity);
                    data.Level.RemoveEntity(topEntity, true);
                    _mPrevious = gridPosition;
                    panel.Invalidate(panel.DisplayRectangle);
                }
                catch (Exception)
                {
                    //If the tile is empty, fail silently
                }
        }
开发者ID:DizWARE,项目名称:Mr-Gravity,代码行数:19,代码来源:DepaintEntity.cs

示例7: PaintScroll

 public static void PaintScroll(ref MouseEventArgs margs,ref Panel listpanel,ref Panel scrollpanel, ref List<Control> controllist)
 {
     panel2 = listpanel;
     listpanel.MouseWheel -= Listpanel_MouseWheel;
     newscrolled += margs.Delta;
     listpanel.MouseWheel += Listpanel_MouseWheel;
     if (newscrolled > oldscrolled)
     {
         selecteditem += 1;
         beginline += 50;
         endline += 50;
     }
     else if (newscrolled < oldscrolled)
     {
         selecteditem -= 1;
         beginline -= 50;
         endline -= 50;
     }
     oldscrolled = newscrolled;
     scrollpanel.Invalidate();
     graphic = scrollpanel.CreateGraphics();
     scrollpanel.Paint += PaintScrollBar;
 }
开发者ID:bakasura980,项目名称:LVideoPlayer,代码行数:23,代码来源:ScrollBar.cs

示例8: DrawShip

 //We draw the ships
 public void DrawShip(int y, int x, int w, int h, int size, Panel panelBattle)
 {
     RemoveShip();
     CreateShip(x, y, 1, size - 1, _Player);
     for (int i = 0; i < _Player.Count(); ++i)
     {
         for (int j = 0; j < _Player[i].Count(); ++j)
         {
             if (Rendering(x, y, i, j, size - 1))
             {
                 panelBattle.Invalidate(new Rectangle(i * w, j * h, w, h));
             }
         }
     }
 }
开发者ID:200755008,项目名称:Client-Serveur,代码行数:16,代码来源:Logic.cs

示例9: panel2_MouseDown

 private void panel2_MouseDown(object sender, MouseEventArgs e)
 {
     Panel painel = (Panel)sender;
     if(e.Button == MouseButtons.Left)
     {
         obj = (Panel) sender;
         Dragging = true;
         mousex = -e.X;
         mousey = -e.Y;
         int clipleft  = panel1.PointToClient(MousePosition).X - obj.Location.X;
         int cliptop = panel1.PointToClient(MousePosition).Y - obj.Location.Y;
         int clipwidth = panel1.ClientSize.Width - (obj.Width - clipleft);
         int clipheight = panel1.ClientSize.Height - (obj.Height - cliptop);
         Cursor.Clip = panel1.RectangleToScreen(new Rectangle(clipleft, cliptop, clipwidth, clipheight));
         obj.Invalidate();
     }
 }
开发者ID:EliasSantosJr,项目名称:SimuladorLPA,代码行数:17,代码来源:FrmProjeto.cs

示例10: InvalidateAndUpdate

 private void InvalidateAndUpdate(Panel panel)
 {
     panel.Invalidate(true);
     panel.Update();
 }
开发者ID:Drainyard,项目名称:LevelEditor,代码行数:5,代码来源:MainEditorWindow.HelperMethods.cs

示例11: mouseEvent

 void mouseEvent(Panel panel, MouseEventArgs e, FileCharset charset)
 {
     int c = e.X / (FileCharset.CharWidth + 2);
     int f = e.Y / (FileCharset.CharHeight + 2);
     byte id = (byte)((f * 16) + c);
     if (e.Button == MouseButtons.Left)
     {
         character = charset.getChar(id);
         panel3.Invalidate();
     }
     else if (e.Button == MouseButtons.Right)
     {
         if (charset!=null && character != null)
             charset.setChar(id, character);
         panel.Invalidate();
     }
 }
开发者ID:rajeper,项目名称:ikarus-osd,代码行数:17,代码来源:FormEditCharset.cs

示例12: CreateView

        public override object CreateView(Panel hostPanel)
        {
            NLView nlView = new NLView();
            if (_image != null)
                nlView.Image = _image.ToBitmap();
            else
                nlView.Image = null;

            nlView.DetectionDetails = _detectionDetails;
            nlView.Dock = DockStyle.Fill;
            hostPanel.Controls.Add(nlView);
            hostPanel.PerformLayout();
            nlView.AutoScroll = true;
            hostPanel.Invalidate();
            return nlView;
        }
开发者ID:rid50,项目名称:PSCBioOffice,代码行数:16,代码来源:FaceRecord.cs

示例13: SelectionSort

 public static void SelectionSort(int[] array, Panel panel)
 {
     // cheating..... should implement algorithm...
     Array.Sort(array);
     panel.Invalidate();
 }
开发者ID:EbbeVang,项目名称:SortingAlgorithms,代码行数:6,代码来源:Sorting.cs

示例14: WocketsScalablePlotter

        public WocketsScalablePlotter(System.Windows.Forms.Panel aPanel)
        {
            this.numSensors = CurrentWockets._Controller._Sensors.Count;

            if (numSensors > 3)
                skippedPoints = 3;
            else if (numSensors > 1)
                skippedPoints = 2;

            this.aPanel = aPanel;
            this.plotAreaSize = new Size(this.aPanel.Width, ((int)(this.aPanel.Height)));
            graphSize = (int)Math.Floor((plotAreaSize.Height / ((double)numSensors)));


            scaleFactors = new double[numSensors];
            currentColumns = new int[numSensors];
            firstColumn = new int[numSensors];
            lastColumn = new int[numSensors];
            decoderTails = new int[numSensors];
            lastUnixTimestamps = new double[numSensors];
            this.pointsToPlot = new int[numSensors];
            this.mode = PlottingMode.Normal;

            for (int i = 0; (i < numSensors); i++)
            {
                this.currentColumns[i] = this.plotAreaSize.Width - 1;
                this.firstColumn[i] = 999999;
                this.lastColumn[i] = this.plotAreaSize.Width - 1;
                this.decoderTails[i] = CurrentWockets._Controller._Sensors[i]._Decoder._Head;
                this.lastUnixTimestamps[i] = 0;
                this.pointsToPlot[i] = 0;
                double range = 1024;//((Accelerometer)this.wocketsController._Sensors[i])._Max - ((Accelerometer)this.wocketsController._Sensors[i])._Min;
                scaleFactors[i] = graphSize / range;
            }


            int dy = (int)Math.Floor(plotAreaSize.Height / ((double)numSensors));
            int offset = dy;
            axisOffset = new int[numSensors];
            for (int i = 0; i < axisOffset.Length; i++)
            {
                axisOffset[i] = offset;
                offset += dy;
            }


            previousTimes = new double[numSensors];
            previousVals = new int[numSensors][];
            for (int i = 0; (i < numSensors); i++)
            {
                previousVals[i] = new int[3];
                for (int j = 0; (j < 3); j++)
                    previousVals[i][j] = 0;
            }


            p = new System.Drawing.Pen[SIGNALS_PER_AXIS];

            p[0] = new Pen(System.Drawing.Color.Orange);
            p[1] = new Pen(System.Drawing.Color.Red);
            p[2] = new Pen(System.Drawing.Color.Blue);
            requiresFullRedraw = true;
            aPanel.Invalidate();

        }
开发者ID:katadam,项目名称:wockets,代码行数:65,代码来源:WocketScalablePlotter.cs


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