Array of labels

This topic contains 1 reply, has 1 voice, and was last updated by  ShikhaTan 2 years, 6 months ago.

  • Author
  • #10836

    I’ve been learning some C# and I want to have a grid of labels appear on my screen when I press the button new.
    Here’s my code so far:

    But when I run it, nothing happens.. Can someone tell me if there is an error in my code I've also tried a jagged array of labels, maybe it'd help, but no:

  • #10837


    You aren’t actually adding the labels to the form control collection so they won’t be drawn.

    Note: If 'this' isn't the context of the form you would need to pass the form instance as a parameter so it knows which form to draw the controls to. Also, you're not adding any label text so the label still won't be visible.

You must be logged in to reply to this topic.