P
Picander
Hello,
I need to create a form with multiple buttons instances. In C#, this
would look like this
static string[] strCaption={"Button A","Button B","Button C"};
Button[] btnShow=new Button[strCaption.Length];
for(int i=0 ; i < strCaption.Length ; i++)
{
btnShow=new Button();
btnShow.Text=strCaption;
btnShow.Size=new Size(200,20);
btnShow.Location=new Point(10,35*i+20);
btnShow.Click+=new EventHandler(Button_Click);
btnShow.Tag=i.ToString();
this.Controls.Add(btnShow);
}
I try to code this in C++, but I have a lot troubles setting the
identifiers.
This:
Button* btnShow[]
....
btnShow=new Button();
....
does not work. Any suggestions/code samples?
Thanks in advance,
Picander
I need to create a form with multiple buttons instances. In C#, this
would look like this
static string[] strCaption={"Button A","Button B","Button C"};
Button[] btnShow=new Button[strCaption.Length];
for(int i=0 ; i < strCaption.Length ; i++)
{
btnShow=new Button();
btnShow.Text=strCaption;
btnShow.Size=new Size(200,20);
btnShow.Location=new Point(10,35*i+20);
btnShow.Click+=new EventHandler(Button_Click);
btnShow.Tag=i.ToString();
this.Controls.Add(btnShow);
}
I try to code this in C++, but I have a lot troubles setting the
identifiers.
This:
Button* btnShow[]
....
btnShow=new Button();
....
does not work. Any suggestions/code samples?
Thanks in advance,
Picander