作者tyc5116 (累人啊....)
看板C_and_CPP
标题[问题] 新增图示
时间Thu Feb 19 14:37:37 2009
请问一下,我现在想要做一个功能
在button上按一下,便会新增出一个picturebox
再按一下,又会再新增出一个picturebox
但这两个picturebox个别的物体
而不是同一个picturebox显示两次
请问该怎麽写呢,目前我是这样写的,这是在button内的事件
static int ID=0;
ID++;
static int x=10;
x+=10;
static int y=20;
y+=10;
String^ Place_Name;
Place_Name="Place"+ID;
Place_ID=gcnew PictureBox();
this->Controls->Add(Place_ID);
Place_ID->BackColor=System::Drawing::Color::Transparent;
Place_ID->Image =gcnew Bitmap(gcnew String(file_name.c_str()));
Place_ID->Location = System::Drawing::Point(x,y);
Place_ID->Name = Place_Name;
Place_ID->Size = System::Drawing::Size(100,100);
Place_ID->SizeMode =
System::Windows::Forms::PictureBoxSizeMode::StretchImage;
Place_ID->BringToFront();
Place_ID->Visible=true;
Place_ID->Click += gcnew System::EventHandler(this,
&Form1::Place_ID_Click);
以及如红色部份,我想让该图示背景是透明的,但我这样打
以及我有对其gif档做去背动作,但还是没有用,我要怎麽改呢?
以上两个问题,谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.18.48.28