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