Results 1 to 3 of 3

Thread: How to add LinkLabel into Panel control

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2004
    Posts
    29

    Red face How to add LinkLabel into Panel control

    Hey guys, i want to add LinkLabels dynamically into a panel. But my code only returns me one linklabel in the panel. The rest of the linklabels doesn't appear. Can you tell me why?

    Code:
    foreach(FileInfo file in directory.GetFiles()) 
    {
       if( file.Extension == ".html" )
       {
         LinkLabel = new LinkLabel();
         LinkLabel.Name = file.Name.Remove(file.Name.Length-5,5);
         LinkLabel.Text = file.Name.Remove(file.Name.Length-5,5);
         LinkLabel.Location = new Point(x, y);
         LinkLabel.Size = new Size(220, 40);
         LinkLabel.Visible = true;
    
         Panel.Controls.Add(LinkLabel);
    
         y += 10;
         } // close if
    } // close foreach

  2. #2
    Lively Member ayan's Avatar
    Join Date
    Jan 2004
    Posts
    112

    Re: How to add LinkLabel into Panel control

    Your y is too small?

    Perhaps change it to 25 as the default height of a label is 23.
    Last edited by ayan; Jan 18th, 2005 at 09:14 PM.


    Keep fit with wossy
    "Finaly I can look as gay as I want..." - NoteMe

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2004
    Posts
    29

    Re: How to add LinkLabel into Panel control

    Wow! u are genius . It works! Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width