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


C# Forms.TableLayoutCellPaintEventArgs类代码示例

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


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

示例1: tableLayoutPanel1_CellPaint

 private void tableLayoutPanel1_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
 {
     if ((e.Column + e.Row) % 2 == 1)
         e.Graphics.FillRectangle(Brushes.Black, e.CellBounds);
     else
         e.Graphics.FillRectangle(Brushes.White, e.CellBounds);
 }
开发者ID:CodyIsAwesome,项目名称:LifeCalendar,代码行数:7,代码来源:Form1.cs

示例2: OnCellPaint

        void OnCellPaint(object sender, TableLayoutCellPaintEventArgs e)
        {
            var c = (NoiseControl)tableLayoutPanel1.GetControlFromPosition(e.Column, e.Row);

            if (c == null)
                return;

            int column = tableLayoutPanel1.GetColumn(c);

            if (e.Column != column)
                return;

            int xSpan = tableLayoutPanel1.GetColumnSpan(c);

            Graphics g = e.Graphics;

            int x1 = e.CellBounds.X;
            int y1 = e.CellBounds.Y;
            int x2 = e.CellBounds.X + e.CellBounds.Width * xSpan;
            int y2 = e.CellBounds.Y + e.CellBounds.Height;

            g.DrawLine(Pens.Red, x1, y1, x1, y2);
            g.DrawLine(Pens.Red, x2, y1, x2, y2);
            if (c.Module.SourceModuleCount == 0)
                g.DrawLine(Pens.Red, x1, y1, x2, y1);
        }
开发者ID:rthome,项目名称:SharpNoise,代码行数:26,代码来源:Form1.cs

示例3: tlpInvoice_CellPaint

 private void tlpInvoice_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
 {
     if (e.Row == 1 || e.Row == tlpInvoice.Controls.Count - 1)
     {
         e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Right, e.CellBounds.Top));
     }
 }
开发者ID:wpscott,项目名称:csis3275,代码行数:7,代码来源:Checkout.cs

示例4: tablePanel_CellPaint

        /// <summary>
        /// Mise en forme du tableau 
        /// </summary>
        private void tablePanel_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
        {
            // Coloriage de la première colonne en 'jaune info'
            if (e.Column == 0)
                e.Graphics.FillRectangle(new SolidBrush(SystemColors.Info), e.CellBounds);

            // Ajout d'une ligne double en bas de la première ligne
            if (e.Row == 0)
                e.Graphics.DrawLine(
                    new Pen(Color.Black, 2),
                    new Point(e.CellBounds.Left,e.CellBounds.Bottom-1),    // -1 pour que l'épaisseur de 2px tienne
                    new Point(e.CellBounds.Right, e.CellBounds.Bottom - 1) // dans la ligne
               );
        }
开发者ID:tanguy2m,项目名称:TaskLeader,代码行数:17,代码来源:EditFilter.cs

示例5: blackTeamPanel_CellPaint

        private void blackTeamPanel_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
        {
            if (pawnChangable && currentState.getMyTeam() == (int)team.black)
            {
                blackTeamPanel.SuspendLayout();

                foreach (Piece piece in gameboard.getDead((int)team.black))
                {
                    double index = gameboard.getDead((int)team.black).IndexOf(piece);
                    int row = (int)Math.Floor(index / 2);
                    int column = (int)index % 2;

                    if (e.Row == row && e.Column == column)
                    {
                        Rectangle r = e.CellBounds;
                        r.Inflate(-1, -1);
                        ControlPaint.DrawBorder(e.Graphics, r, Color.Black, 2, ButtonBorderStyle.Solid, Color.Black, 2, ButtonBorderStyle.Solid, Color.Black, 2, ButtonBorderStyle.Solid, Color.Black, 2, ButtonBorderStyle.Solid);
                    }
                }

                blackTeamPanel.ResumeLayout();
            }
        }
开发者ID:mapplet,项目名称:Chess,代码行数:23,代码来源:game.cs

示例6: OnCellPaint

        protected override void OnCellPaint(TableLayoutCellPaintEventArgs e)
        {
            base.OnCellPaint(e);

            Control c = this.GetControlFromPosition(e.Column, e.Row);

            if (c != null)
            {
                Graphics g = e.Graphics;

                g.DrawRectangle(
                    Pens.Red,
                    e.CellBounds.Location.X + 1,
                    e.CellBounds.Location.Y + 1,
                    e.CellBounds.Width - 2, e.CellBounds.Height - 2);

                g.FillRectangle(
                    Brushes.Blue,
                    e.CellBounds.Location.X + 1,
                    e.CellBounds.Location.Y + 1,
                    e.CellBounds.Width - 2,
                    e.CellBounds.Height - 2);
            };
        }
开发者ID:777ondro,项目名称:sw-en,代码行数:24,代码来源:Form10.cs

示例7: tableLayoutPanel1_CellPaint

 private void tableLayoutPanel1_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
 {
     if (e.Row == 1 && e.Column == 0)
     {
         e.Graphics.FillRectangle(new SolidBrush(Color.LightGray), e.CellBounds);
     }
     if (e.Row == 1 && e.Column == 1)
     {
         e.Graphics.FillRectangle(new SolidBrush(Color.LightGray), e.CellBounds);
     }
 }
开发者ID:CJ2311,项目名称:Battlelogium,代码行数:11,代码来源:BattlelogiumConfigEditor.cs

示例8: onTblLayoutCellPaint

 /// <summary>
 /// Handles various table layout panels' cell paint events for hover background.
 /// </summary>
 private void onTblLayoutCellPaint(object sender, TableLayoutCellPaintEventArgs e)
 {
     // No hover: all backgrounds default.
     if (hoverIx == -1) return;
     Label lblHover = lblColl[hoverIx];
     object hoverTable;
     int rowIx = -1;
     if (lblHover == lblFullFormatted || lblHover == lblFullCedict)
     {
         hoverTable = tblFull;
         rowIx = lblHover == lblFullFormatted ? 1 : 2;
     }
     else if (lblHover == lblHanzi1 || lblHover == lblHanzi2 || lblHover == lblPinyin)
     {
         hoverTable = tblZho;
         if (lblHover == lblHanzi1) rowIx = 1;
         else if (lblHover == lblHanzi2) rowIx = 2;
         else rowIx = lblHanzi2 == null ? 2 : 3;
     }
     else
     {
         hoverTable = tblSense;
         rowIx = 1;
     }
     if (sender == hoverTable && e.Row == rowIx)
     {
         using (Brush b = new SolidBrush(ZenParams.CtxtMenuHoverColor))
         {
             Rectangle rect = e.CellBounds;
             rect.Width = e.ClipRectangle.Width;
             e.Graphics.FillRectangle(b, rect);
             rect.X = 0;
             e.Graphics.FillRectangle(b, rect);
         }
     }
 }
开发者ID:sheeeng,项目名称:Zydeo,代码行数:39,代码来源:ResultsCtxtControl.cs

示例9: TableTop_CellPaint

 private void TableTop_CellPaint( object sender, TableLayoutCellPaintEventArgs e )
 {
     if ( e.Row == 1 || e.Row == 3 )
         e.Graphics.DrawLine( Pens.Silver, e.CellBounds.X, e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1 );
 }
开发者ID:Glaceon-Hyy,项目名称:ElectronicObserver,代码行数:5,代码来源:FormBattle.cs

示例10: BeginInvoke

        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// tablelayoutcellpainteventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this TableLayoutCellPaintEventHandler tablelayoutcellpainteventhandler, Object sender, TableLayoutCellPaintEventArgs e, AsyncCallback callback)
        {
            if(tablelayoutcellpainteventhandler == null) throw new ArgumentNullException("tablelayoutcellpainteventhandler");

            return tablelayoutcellpainteventhandler.BeginInvoke(sender, e, callback, null);
        }
开发者ID:peteraritchie,项目名称:ProductivityExtensions,代码行数:12,代码来源:TableLayoutCellPaintEventHandlerable.g.cs

示例11: TableEnemyCandidateMember_CellPaint

		private void TableEnemyCandidateMember_CellPaint( object sender, TableLayoutCellPaintEventArgs e ) {

			if ( _enemyFleetCandidate == null || _enemyFleetCandidateIndex + e.Column >= _enemyFleetCandidate.Count )
				return;


			e.Graphics.DrawLine( Pens.Silver, e.CellBounds.Right - 1, e.CellBounds.Top, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1 );

			if ( e.Row == 5 || e.Row == 7 ) {
				e.Graphics.DrawLine( Pens.Silver, e.CellBounds.X, e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1 );
			}
		}
开发者ID:silfumus,项目名称:ElectronicObserver,代码行数:12,代码来源:FormCompass.cs

示例12: setStatus_CellPaint

 private void setStatus_CellPaint(int court, TableLayoutCellPaintEventArgs e)
 {
     foreach (DataRow row in reserve_data.Rows)
     {
         int id = row.Field<int>(0);
         int court_id = row.Field<int>(2);
         string date = row.Field<DateTime>(4).ToString("yyyy-MM-dd");
         int start_time = int.Parse(DateTime.Parse(row.Field<TimeSpan>(5).ToString()).ToString("HH"));
         int end_time = int.Parse(DateTime.Parse(row.Field<TimeSpan>(6).ToString()).ToString("HH"));
         int status = row.Field<int>(8);
         if (date.Equals(dtpDate.Text))
         {
             if (court == court_id)
             {
                 while (start_time < end_time)
                 {
                     if (start_time == 06)
                     {
                         if (e.Row == 0 && e.Column == 0)
                         {
                             if (status == 3) { e.Graphics.FillRectangle(Brushes.Gold, e.CellBounds); }
                             if (status == 2) { e.Graphics.FillRectangle(Brushes.Firebrick, e.CellBounds); }
                             if (status == 1) { e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.CellBounds); }
                         }
                     }
                     if (start_time == 07)
                     {
                         if (e.Row == 0 && e.Column == 1)
                         {
                             if (status == 3) { e.Graphics.FillRectangle(Brushes.Gold, e.CellBounds); }
                             if (status == 2) { e.Graphics.FillRectangle(Brushes.Firebrick, e.CellBounds); }
                             if (status == 1) { e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.CellBounds); }
                         }
                     }
                     if (start_time == 08)
                     {
                         if (e.Row == 0 && e.Column == 2)
                         {
                             if (status == 3) { e.Graphics.FillRectangle(Brushes.Gold, e.CellBounds); }
                             if (status == 2) { e.Graphics.FillRectangle(Brushes.Firebrick, e.CellBounds); }
                             if (status == 1) { e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.CellBounds); }
                         }
                     }
                     if (start_time == 09)
                     {
                         if (e.Row == 0 && e.Column == 3)
                         {
                             if (status == 3) { e.Graphics.FillRectangle(Brushes.Gold, e.CellBounds); }
                             if (status == 2) { e.Graphics.FillRectangle(Brushes.Firebrick, e.CellBounds); }
                             if (status == 1) { e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.CellBounds); }
                         }
                     }
                     if (start_time == 10)
                     {
                         if (e.Row == 0 && e.Column == 4)
                         {
                             if (status == 3) { e.Graphics.FillRectangle(Brushes.Gold, e.CellBounds); }
                             if (status == 2) { e.Graphics.FillRectangle(Brushes.Firebrick, e.CellBounds); }
                             if (status == 1) { e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.CellBounds); }
                         }
                     }
                     if (start_time == 11)
                     {
                         if (e.Row == 0 && e.Column == 5)
                         {
                             if (status == 3) { e.Graphics.FillRectangle(Brushes.Gold, e.CellBounds); }
                             if (status == 2) { e.Graphics.FillRectangle(Brushes.Firebrick, e.CellBounds); }
                             if (status == 1) { e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.CellBounds); }
                         }
                     }
                     if (start_time == 12)
                     {
                         if (e.Row == 1 && e.Column == 0)
                         {
                             if (status == 3) { e.Graphics.FillRectangle(Brushes.Gold, e.CellBounds); }
                             if (status == 2) { e.Graphics.FillRectangle(Brushes.Firebrick, e.CellBounds); }
                             if (status == 1) { e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.CellBounds); }
                         }
                     }
                     if (start_time == 13)
                     {
                         if (e.Row == 1 && e.Column == 1)
                         {
                             if (status == 3) { e.Graphics.FillRectangle(Brushes.Gold, e.CellBounds); }
                             if (status == 2) { e.Graphics.FillRectangle(Brushes.Firebrick, e.CellBounds); }
                             if (status == 1) { e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.CellBounds); }
                         }
                     }
                     if (start_time == 14)
                     {
                         if (e.Row == 1 && e.Column == 2)
                         {
                             if (status == 3) { e.Graphics.FillRectangle(Brushes.Gold, e.CellBounds); }
                             if (status == 2) { e.Graphics.FillRectangle(Brushes.Firebrick, e.CellBounds); }
                             if (status == 1) { e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.CellBounds); }
                         }
                     }
                     if (start_time == 15)
                     {
                         if (e.Row == 1 && e.Column == 3)
//.........这里部分代码省略.........
开发者ID:chanerdo,项目名称:powersmashOnlineReservation,代码行数:101,代码来源:frmMain.cs

示例13: ColorCell

 private void ColorCell(TableLayoutCellPaintEventArgs e, Color c)
 {
     Graphics g = e.Graphics;
     Rectangle r = e.CellBounds;
     g.FillRectangle(new SolidBrush(c), r);
 }
开发者ID:udiyetter,项目名称:FinalProjectUdiTal,代码行数:6,代码来源:LoginForm.cs

示例14: tableLayoutPanel1_CellPaint

 private void tableLayoutPanel1_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
 {
     if (e.Column == 0 || e.Row == 0)
     {
         ColorCell(e, Color.FromKnownColor(KnownColor.LightSteelBlue));
     }
 }
开发者ID:udiyetter,项目名称:FinalProjectUdiTal,代码行数:7,代码来源:LoginForm.cs

示例15: tableLayout_Layers_CellPaint

        private void tableLayout_Layers_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
        {
            Color cr = Color.FromName("blue");
            SolidBrush sb = new System.Drawing.SolidBrush(cr);

            if (e.Column == z.WybranyLayers+1)
                e.Graphics.FillRectangle(sb, e.CellBounds);

            checkBox_Ghost0.BackColor = Color.FromName("control");
            checkBox_Ghost1.BackColor = Color.FromName("control");
            checkBox_Ghost2.BackColor = Color.FromName("control");
            checkBox_Ghost3.BackColor = Color.FromName("control");
            checkBox_GhostSecure0.BackColor = Color.FromName("control");
            checkBox_GhostSecure1.BackColor = Color.FromName("control");
            checkBox_GhostSecure2.BackColor = Color.FromName("control");
            checkBox_GhostSecure3.BackColor = Color.FromName("control");
            label_Ghost0.BackColor = Color.FromName("control");
            label_Ghost1.BackColor = Color.FromName("control");
            label_Ghost2.BackColor = Color.FromName("control");
            label_Ghost3.BackColor = Color.FromName("control");

            if (z.WybranyLayers == 0)
                label_Ghost0.BackColor = checkBox_GhostSecure0.BackColor = checkBox_Ghost0.BackColor = cr;
            if (z.WybranyLayers == 1)
                label_Ghost1.BackColor = checkBox_GhostSecure1.BackColor = checkBox_Ghost1.BackColor = cr;
            if (z.WybranyLayers == 2)
                label_Ghost2.BackColor = checkBox_GhostSecure2.BackColor = checkBox_Ghost2.BackColor = cr;
            if (z.WybranyLayers == 3)
                label_Ghost3.BackColor = checkBox_GhostSecure3.BackColor = checkBox_Ghost3.BackColor = cr;
        }
开发者ID:danplus,项目名称:DanCasperEditor,代码行数:30,代码来源:Form1.cs


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