/// <summary>
/// Creates the panel on the form
/// </summary>
/// <returns>Returns the panel created</returns>
public IPanel CreateControlPanel()
{
IPanel panel = _controlFactory.CreatePanel();
ILabel label = _controlFactory.CreateLabel(_message, false);
ColumnLayoutManager columnLayoutManager = new ColumnLayoutManager(panel, _controlFactory);
columnLayoutManager.AddControl(label);
columnLayoutManager.AddControl(_comboBox);
panel.Height = _comboBox.Height + label.Height + columnLayoutManager.BorderSize + columnLayoutManager.VerticalGapSize;
int preferredWidth = label.PreferredWidth + 20;
int preferredWidthFromCombo = GetLongestComboText() + 40;
if (preferredWidthFromCombo > preferredWidth)
{
preferredWidth = preferredWidthFromCombo;
}
if (preferredWidth < 200)
{
preferredWidth = 200;
}
panel.Width = preferredWidth;
_comboBox.Width = panel.Width - 30;
panel.MinimumSize = panel.Size;
return(panel);
}