Hi wsprhino;
In the class TileRhombEdgesPanel you set up the comboBox at design time with these values:
//
// lwcbxThinThinWidth
//
this.lwcbxThinThinWidth.BackColor = System.Drawing.SystemColors.Window;
this.lwcbxThinThinWidth.DropDownWidth = 70;
this.lwcbxThinThinWidth.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
this.lwcbxThinThinWidth.FormattingEnabled = true;
this.lwcbxThinThinWidth.Items.AddRange(new object[] {
"Narrow",
"Normal",
"Wide",
"Extra Wide"});
this.lwcbxThinThinWidth.Location = new System.Drawing.Point(62, 19);
this.lwcbxThinThinWidth.Name = "lwcbxThinThinWidth";
this.lwcbxThinThinWidth.Size = new System.Drawing.Size(85, 23);
this.lwcbxThinThinWidth.TabIndex = 334;
Then just before the form is displayed to the user the system calls the class LineWidthComboBox OnCreateControl which does the following:
base.OnCreateControl();
this.BeginUpdate();
this.Items.Clear();
this.Items.Add("Narrow");
this.Items.Add("Normal");
this.Items.Add("Wide");
this.Items.Add("Extra Wide");
this.EndUpdate();
this.Size = new Size(85, 24);
this.Font = new Font("Microsoft San Serif", 9.00f, FontStyle.Regular);
The first thing you do after the BeginUpdate call is to clear all the values from the dropdown list and then re-populate the drop down values then re-sets the SelectedIndex to -1, no selection. If you comment out the code from the BeginUpdate to the EndUpdate then the combo box will display correctly.
Another thing in this same code is that the InitializeComponent never gets called because there is no call to it in the constructor.
In the code file Program.cs you have this:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
TileRhombEdgesForm tref = new TileRhombEdgesForm();
tref.ThinThinEdgeWidth = LineWidth.LineWidthValue.Wide;
Application.Run(tref);
Anything you do to the TileRhombEdgesForm class before the call to Application.Run that will cause an event to be triggered will not occurr because the Application.Run is where the windows message loop gets started. Any changes to the class should be done in the constructor.
Fernando