本文整理汇总了C#中System.Windows.Forms.ComboBox.AdjustWidth方法的典型用法代码示例。如果您正苦于以下问题:C# ComboBox.AdjustWidth方法的具体用法?C# ComboBox.AdjustWidth怎么用?C# ComboBox.AdjustWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ComboBox
的用法示例。
在下文中一共展示了ComboBox.AdjustWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _ConfigureSettingsFormForANN
private void _ConfigureSettingsFormForANN(BaseSettingsForm oSettingsForm)
{
oSettingsForm.MainTableLayout.RowStyles.Add(new RowStyle(SizeType.AutoSize));
oSettingsForm.MainTableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
oSettingsForm.MainTableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
{
oSettingsForm.MainTableLayout.Controls.Add(UIExtensions.LabelWithTextAndName(strings.hiddenCountsLabelText, "hiddenCountsLabel"),
0, oSettingsForm.MainTableLayout.GetRowHeights().Length);
}
{
TextBox hiddenCountsTextBox = new TextBox();
hiddenCountsTextBox.Name = "hiddenCountsTextBox";
hiddenCountsTextBox.Text = string.Join(" ", ANNmodelBuilder.kDefaultNeuronsCount.Take(ANNmodelBuilder.kDefaultNeuronsCount.Count() - 1));
hiddenCountsTextBox.Validating += new System.ComponentModel.CancelEventHandler(_settingsFormHiddenCountsTextBox_Validating);
hiddenCountsTextBox.Validated += new EventHandler(_settingsFormHiddenCountsTextBox_Validated);
oSettingsForm.MainTableLayout.Controls.Add(hiddenCountsTextBox, 1, oSettingsForm.MainTableLayout.GetRowHeights().Length - 1);
}
{
oSettingsForm.MainTableLayout.Controls.Add(UIExtensions.LabelWithTextAndName(strings.activationFuncLabelText, "activationFuncLabel"),
0, oSettingsForm.MainTableLayout.GetRowHeights().Length);
}
{
ComboBox activationFuncComboBox = new ComboBox();
activationFuncComboBox.Items.AddRange(ANNmodelBuilder.ActivationFunctionsDict.Keys.ToArray());
activationFuncComboBox.Text = ANNmodelBuilder.kDefaultActivationFunction;
activationFuncComboBox.AdjustWidth();
activationFuncComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
activationFuncComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
activationFuncComboBox.SelectedIndexChanged += new EventHandler(_settingsFormActivationFuncComboBox_SelectedIndexChanged);
activationFuncComboBox.Name = "activationFuncComboBox";
oSettingsForm.MainTableLayout.Controls.Add(activationFuncComboBox, 1, oSettingsForm.MainTableLayout.GetRowHeights().Length - 1);
}
oSettingsForm.SecondaryTableLayout.RowStyles.Add(new RowStyle(SizeType.AutoSize));
oSettingsForm.SecondaryTableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
oSettingsForm.SecondaryTableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
{
oSettingsForm.SecondaryTableLayout.Controls.Add(UIExtensions.LabelWithTextAndName(strings.maxIterationsCountLabelText, "maxIterationsCountLabel"),
0, oSettingsForm.SecondaryTableLayout.GetRowHeights().Length);
}
{
TextBox maxIterationsCountTextBox = new TextBox();
maxIterationsCountTextBox.Name = "hiddenCountsTextBox";
maxIterationsCountTextBox.Text = ANNmodelBuilder.kMaxInterationsNum.ToString();
maxIterationsCountTextBox.Validating += new System.ComponentModel.CancelEventHandler(UIExtensions.uintTextBox_Validating);
maxIterationsCountTextBox.Validated += new EventHandler(_settingsFormHiddenCountsTextBox_Validated);
oSettingsForm.SecondaryTableLayout.Controls.Add(maxIterationsCountTextBox, 1, oSettingsForm.SecondaryTableLayout.GetRowHeights().Length - 1);
}
{
oSettingsForm.SecondaryTableLayout.Controls.Add(UIExtensions.LabelWithTextAndName(strings.stopErrorLabelText,
"stopErrorLabel"), 0, oSettingsForm.SecondaryTableLayout.GetRowHeights().Length);
}
{
TextBox stopErrorTextBox = new TextBox();
stopErrorTextBox.Name = "stopErrorTextBox";
stopErrorTextBox.Text = ANNmodelBuilder.kStopError.ToString();
stopErrorTextBox.Validating += new System.ComponentModel.CancelEventHandler(UIExtensions.doubleTextBox_Validating);
stopErrorTextBox.Validated += new EventHandler(_settingsFormStopErrorTextBox_Validated);
oSettingsForm.SecondaryTableLayout.Controls.Add(stopErrorTextBox, 1, oSettingsForm.SecondaryTableLayout.GetRowHeights().Length - 1);
}
oSettingsForm.MainTabControl.Size = new Size(Math.Max(oSettingsForm.MainTableLayout.Size.Width, oSettingsForm.SecondaryTableLayout.Size.Width) + 10,
Math.Max(oSettingsForm.MainTableLayout.Size.Height, oSettingsForm.SecondaryTableLayout.Size.Height) + 50);
//TODO: VERY MESSY! CONSIDER CREATING CUSTOM CONTROLS, THAT FIT THE NEEDS!!
}