By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,335 Members | 2,281 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,335 IT Pros & Developers. It's quick & easy.

C# Panel Issue

P: 384
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??
Expand|Select|Wrap|Line Numbers
  1. Label error = new label();
  2. error.Text = "Unable to retrieve recent list.";
  3. panRecentList.Controls.Add(error);
Jan 19 '09 #1
Share this Question
Share on Google+
4 Replies

Expert 5K+
P: 7,872
Whatever function in dbqueries.cs that frmMain calls, have return a Panel object as its return parameter.
Jan 19 '09 #2

P: 384
Nice one, i got the panel being returned, next little thing is i have this code.
Expand|Select|Wrap|Line Numbers
  1. label.Text = "ERROR: Unable to retrieve recent list.";
  2. panel.Controls.Add(label);
But only 'ERROR: Unable' is being displayed on the panel? I have the panel width set to 659!??
Jan 20 '09 #3

Expert 5K+
P: 7,872
When you created the Label object, did you set the Location and Size proeprties?
Jan 20 '09 #4

P: 13,264
What other controls are on that panel?
Jan 21 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.