nevin cm

nevin cm

  • NA
  • 27
  • 0

Label Arrays

Apr 13 2007 4:51 AM
 

hi friends

 

i tried to create a label array and show label in a button click at runtime .But its not working .it stops execution at the seccon line .If anybody help me ,i would be very thankful to you . . i need  a an array of text without a fixed length. just like we declare
in VB.NET [ Dim label () as string ] . is this type of declaration possible in C#

 below given is the code i tried

 

 

 

private void button1_Click(object sender, System.EventArgs e)

{

Label [] labelnew=null;

 

int j;

for (j=1 ;j<=3;j++)

{

labelnew[j]= new System.Windows.Forms.Label();

labelnew[j].Location= new System.Drawing.Point(200,j*20);

labelnew[j].Name="labelnew"+j;

labelnew[j].TabIndex=0;

 

}

 

 

thanks & regards



Answers (2)