C# Panel Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ziycon
    Contributor
    • Sep 2008
    • 384

    C# Panel Issue

    I have a form called frmMain and it calls a function in DBQueries.cs, there is a panel created in the DBQueries class and i need to add it to a panel that already exists in the frmMain, i just can't figure out how to reference the panel in frmMain??

    panRecentList is the panel on frmMain and this code is in DBQueries, how do i reference the last like of the code here??
    Code:
    Label error = new label();
    error.Text = "Unable to retrieve recent list.";
    panRecentList.Controls.Add(error);
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Whatever function in dbqueries.cs that frmMain calls, have return a Panel object as its return parameter.

    Comment

    • ziycon
      Contributor
      • Sep 2008
      • 384

      #3
      Nice one, i got the panel being returned, next little thing is i have this code.
      Code:
      label.Text = "ERROR: Unable to retrieve recent list.";
      panel.Controls.Add(label);
      But only 'ERROR: Unable' is being displayed on the panel? I have the panel width set to 659!??

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        When you created the Label object, did you set the Location and Size proeprties?

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          What other controls are on that panel?

          Comment

          Working...