「東雲 忠太郎」の平凡な日常のできごと

「東雲 忠太郎」の平凡な日常のできごと

2011.05.18
XML
カテゴリ: カテゴリ未分類



using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1

public partial class Form1 : Form
{
//コンストラクタ
public Form1()
{
InitializeComponent();
}

//画面ロード
private void Form1_Load(object sender, EventArgs e)
{
//通常のボタン列を作成

//ボタン列を拡張ボタンに設定
dgvBtnCols.CellTemplate = new DataGridButtonCellEx();
this.dataGridView1.Columns.Add(dgvBtnCols);
}
}


//DataGridViewButtonCellの拡張クラスを作成
/****************************************************************/
public partial class DataGridButtonCellEx : DataGridViewButtonCell
{
protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates elementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
{
base.Paint(graphics, clipBounds, cellBounds, rowIndex, elementState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts);
TextRenderer.DrawText(graphics, "◎", this.DataGridView.Font, cellBounds, Color.Blue);
}
}
}






お気に入りの記事を「いいね!」で応援しよう

Last updated  2011.05.18 21:30:42


【毎日開催】
15記事にいいね!で1ポイント
10秒滞在
いいね! -- / --
おめでとうございます!
ミッションを達成しました。
※「ポイントを獲得する」ボタンを押すと広告が表示されます。
x
X

© Rakuten Group, Inc.
X
Design a Mobile Site
スマートフォン版を閲覧 | PC版を閲覧
Share by: