当前位置: 首页>>代码示例>>C#>>正文


C# ComboBox.AdjustWidth方法代码示例

本文整理汇总了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!!
        }
开发者ID:vladislav-horbatiuk,项目名称:time-series-forecasting,代码行数:64,代码来源:BSModelBuilderComponent.cs


注:本文中的System.Windows.Forms.ComboBox.AdjustWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。