- 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(); } }
|

|