I have several shortcuts and a bunch of TextBox that I want to dynamically add to the Panel. Text fields are added OK and are clearly visible, but these labels are not. Here is the code I use to add shortcuts.
C # is written for the .NET 3.5 WinForms application.
Label lblMotive = new Label(); lblMotive.Text = language.motive; lblMotive.Location = new Point(0, 0); Label lblDiagnosis = new Label(); lblDiagnosis.Text = language.diagnosis; lblDiagnosis.Location = new Point(20, 0); panelServiceMotive.Controls.Add(lblMotive); panelServiceMotive.Controls.Add(lblDiagnosis);
panelServiceMotive is a Panel control that should display shortcuts, as well as the previously mentioned text fields. language is an object of a self-written language class that works fine and does not matter here.
I hope there is enough information to get help.
source share