[表示 : 全て 最新50 1-99 101- 201- 301- 401- 2chのread.cgiへ]
Update time : 02/16 13:16 / Filesize : 126 KB / Number-of Response : 495
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

C#, C♯, C#相談室 Part50



62 名前:デフォルトの名無しさん [2008/12/24(水) 08:52:44 ]
質問です。

独自のプロパティをもたせたボタンを作ろうと
Buttonクラスを継承してクラスを作ったのですが、
フォームに生成(描画?)できません。
どうやったら生成されるのでしょうか?

public class HageButton : Button
{
HageProperty m_hage; //独自プロパティ

private void CreateHageButton(int maxButtons)
{
Button[] m_customBtn = new Button[maxButtons];

int loopButtonIndex = 0;
for (loopButtonIndex = 0; loopButtonIndex < maxButtons; loopButtonIndex++)
{
//↓現状固定値で入れてますが、上手くいかない為で、本来は独自プロパティから読み込んだ座標の設定が入ります。
m_customBtn[loopButtonIndex] = new System.Windows.Forms.Button();
m_customBtn[loopButtonIndex].Location = new System.Drawing.Point(100, 200);
m_customBtn[loopButtonIndex].Name = "btn_Config";
m_customBtn[loopButtonIndex].Size = new System.Drawing.Size(117, 33);
m_customBtn[loopButtonIndex].TabIndex = 2;
m_customBtn[loopButtonIndex].Text = "Hage";
m_customBtn[loopButtonIndex].UseVisualStyleBackColor = true;
m_customBtn[loopButtonIndex].Visible = true;
m_customBtn[loopButtonIndex].Click += new System.EventHandler(this.hageFunction);
m_customBtn[loopButtonIndex].Refresh();
m_customBtn[loopButtonIndex].Show();
}
}






[ 続きを読む ] / [ 携帯版 ]

全部読む 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<126KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef