本文整理汇总了C#中System.Windows.Forms.TableLayoutCellPaintEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# TableLayoutCellPaintEventArgs类的具体用法?C# TableLayoutCellPaintEventArgs怎么用?C# TableLayoutCellPaintEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableLayoutCellPaintEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了TableLayoutCellPaintEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: tableLayoutPanel4_CellPaint
private void tableLayoutPanel4_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
{
Color cr = Color.FromName("blue");
SolidBrush sb = new System.Drawing.SolidBrush(cr);
if (e.Column == z.WybranaFrame)
e.Graphics.FillRectangle(sb, e.CellBounds);
label_frame0.BackColor = Color.FromName("control");
label_frame1.BackColor = Color.FromName("control");
label_frame2.BackColor = Color.FromName("control");
label_frame3.BackColor = Color.FromName("control");
label_frame4.BackColor = Color.FromName("control");
label_frame5.BackColor = Color.FromName("control");
if (z.WybranaFrame == 0) label_frame0.BackColor = cr;
if (z.WybranaFrame == 1) label_frame1.BackColor = cr;
if (z.WybranaFrame == 2) label_frame2.BackColor = cr;
if (z.WybranaFrame == 3) label_frame3.BackColor = cr;
if (z.WybranaFrame == 4) label_frame4.BackColor = cr;
if (z.WybranaFrame == 5) label_frame5.BackColor = cr;
label_frame0.Refresh();
label_frame1.Refresh();
label_frame2.Refresh();
label_frame3.Refresh();
label_frame4.Refresh();
label_frame5.Refresh();
}
开发者ID:danplus,项目名称:DanCasperEditor,代码行数:29,代码来源:Form1.cs
示例17: tlp_CellPaint
private void tlp_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
{
var panel = sender as TableLayoutPanel;
Rectangle rect = e.CellBounds;
Graphics g = e.Graphics;
int column = e.Column, row = e.Row;
if ((column == 0 && (row < 8 && row > 0 || row == 11)) || (row == 0 && column < 12 && column > 0))
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 250, 150, 70)), rect);
else if ((column == 0 && row == 8) || (row == 0 && (column == 12 || column == 13)))
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 190, 80, 80)), rect);
else if (row > 0 && row < 8 && column > 0 && column < 12)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 250, 230, 220)), rect);
else if (column > 11 && row > 0 && row < 8)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 240, 220, 220)), rect);
else if (row == 8 && column > 0 && column < 12)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 220, 150, 150)), rect);
else if (row == 9 && column == 0)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 130, 100, 160)), rect);
else if (row == 9 && column > 0 && column < 12)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 180, 160, 200)), rect);
else if (row == 10 && column == 0)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 160, 190, 90)), rect);
else if (row == 10 && column > 0 && column < 12)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 195, 215, 155)), rect);
else if (row == 11 && column > 0 && column < 12)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 250, 190, 145)), rect);
else if (row == 12 && column == 0)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 75, 170, 200)), rect);
else if (row == 12 && column > 0 && column < 12)
g.FillRectangle(new SolidBrush(Color.FromArgb(255, 145, 205, 220)), rect);
using (var pen = new Pen(Color.Black, 1))
{
if (row == (panel.RowCount - 1))
rect.Height -= 1;
if (column == (panel.ColumnCount - 1))
rect.Width -= 1;
if ((row != 0 || column != 0) && (column < 12 || row < 8))
g.DrawRectangle(pen, rect);
}
}
开发者ID:Beraliv,项目名称:Csharp,代码行数:43,代码来源:Week+Table.cs
示例18: SplitsTableCellPaint
private void SplitsTableCellPaint(object sender, TableLayoutCellPaintEventArgs e)
{
int leftX = e.CellBounds.X;
int rightX = e.CellBounds.X + e.CellBounds.Width;
int topY = e.CellBounds.Y;
int bottomY = e.CellBounds.Y + e.CellBounds.Height;
if (SHOW_FINAL_SPLIT && Scrollable)
{
if (e.Row == GetNumSplitsWithoutFinal())
{
//bottom line
e.Graphics.DrawLine(new Pen(Color.Gray), leftX, bottomY, rightX, bottomY);
//top line
if (Run != null)
{
if (Run.CurrentSplitIndex < Run.Count - NUM_UPCOMING_SPLITS - 2)
e.Graphics.DrawLine(new Pen(Color.Gray), leftX, topY, rightX, topY);
}
else
e.Graphics.DrawLine(new Pen(Color.Gray), leftX, topY, rightX, topY);
}
}
if (Run != null)
{
if (!Run.LastSplitDone())
{
for (int i = 0; i < Splits.Length; i++)
{
if (Run.GetCurrentSplit() == Splits[i].Split && e.Row == i)
{
e.Graphics.FillRectangle(new SolidBrush(CURRENT_SPLIT_BACKGROUND_COLOR), e.CellBounds);
}
}
}
}
}
开发者ID:WimReddingius,项目名称:SourceLiveTimer,代码行数:40,代码来源:SplitsUI.cs
示例19: tableLayoutPanel_content_CellPaint
private void tableLayoutPanel_content_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
{
/*
Brush brush = new SolidBrush(Color.Red);
Rectangle rect = Rectangle.Inflate(e.CellBounds, -1, -1);
e.Graphics.FillRectangle(brush, rect);
* */
if (this.m_nInSuspend > 0)
return; // 防止闪动
// Rectangle rect = Rectangle.Inflate(e.CellBounds, -1, -1);
Rectangle rect = e.CellBounds;
Pen pen = new Pen(Color.FromArgb(200,200,200));
e.Graphics.DrawRectangle(pen, rect);
}
开发者ID:paopaofeng,项目名称:dp2,代码行数:15,代码来源:OrderDesignControl2.cs
示例20: OnCellPaint
protected virtual void OnCellPaint (TableLayoutCellPaintEventArgs e)
{
TableLayoutCellPaintEventHandler eh = (TableLayoutCellPaintEventHandler)(Events [CellPaintEvent]);
if (eh != null)
eh (this, e);
}
开发者ID:Profit0004,项目名称:mono,代码行数:6,代码来源:TableLayoutPanel.cs
注:本文中的System.Windows.Forms.TableLayoutCellPaintEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论