06/01/30 11:50:49
//チラシの裏。
//Visual C++2005 Express Edition
//Form1にButton1 と Label1 と pictureBox1を貼り付ける。
// Button1をダブルクリックした所のbutton1_Clickに次のコードを書く。
label1->Text = L"押されました";
Graphics^ g;
Pen^ p;
int nw , nh;
nw = pictureBox1->Width ;
nh = pictureBox1->Height ;
p= gcnew Pen(Color::Black ,3);
pictureBox1->Image = gcnew Bitmap(nw , nh );
g = Graphics::FromImage (pictureBox1->Image );
g->DrawRectangle (p,0,0,nw , nh );
g->DrawLine(Pens::Blue , 0 , nh , nw/2 , nh/2 );
g->DrawLine(Pens::Blue , nw/2 , nh/2 , nw , nh);
pictureBox1->Refresh();