I’m trying to show and hide a pop-up when certain events occur. The pop-up is appearing and disappearing properly, but all of its labels are blank. I originally was trying to populate the labels prior to showing the form, but I’ve commented-out all of that logic. The labels are all blank, but the space is properly allocated for each label (see screenshot).
my popup control:
public MyPopUp()
{
InitializeComponent();
}
my separate class:
MyPopUp _MyPopUp;
protected override void OnLoad(IServiceProvider myServiceProvider)
{
_MyPopUp = new MyPopUp();
}
protected override void WhenSomethingHappens() {
_MyPopUp.Show();
}
protected override void WhenSomethingElseHappens() {
_MyPopUp.Hide();
}
Here is part of my designer.cs file. I've only copy/pasted the code from one of the labels, but the other 5 labels on the form have nearly-identical code.
private System.Windows.Forms.Label label1;
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(58, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Some Label Text";
//
// MyPopUp
//
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "MyPopUp";
this.Text = "Some Text";
this.ResumeLayout(false);
this.PerformLayout();
}