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


C# ComboBox.Update方法代码示例

本文整理汇总了C#中System.Windows.Forms.ComboBox.Update方法的典型用法代码示例。如果您正苦于以下问题:C# ComboBox.Update方法的具体用法?C# ComboBox.Update怎么用?C# ComboBox.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ComboBox的用法示例。


在下文中一共展示了ComboBox.Update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetList

        Boolean SetList(ComboBox cb, IEnumerable data)
        {
            if (cb == null || data == null) return false;

            try
            {
                if (!(data is IList))
                {
                    List<Object> list = new List<Object>();
                    foreach (Object item in data)
                    {
                        list.Add(item);
                    }
                    data = list;
                }
                cb.DataSource = data;
                //cb.DisplayMember = "value";
                cb.Update();

                return true;
            }
            catch (Exception ex)
            {
                XTrace.WriteException(ex);
                return false;
            }
        }
开发者ID:g992com,项目名称:esb,代码行数:27,代码来源:FrmSchema.cs

示例2: BindTemplate

        public void BindTemplate(ComboBox cb)
        {
            var list = new List<String>();
            foreach (var item in Engine.FileTemplates)
            {
                list.Add("[文件]" + item);
            }
            foreach (String item in Engine.Templates.Keys)
            {
                String[] ks = item.Split('.');
                if (ks == null || ks.Length < 1) continue;

                String name = "[内置]" + ks[0];
                if (!list.Contains(name)) list.Add(name);
            }
            cb.Items.Clear();
            cb.DataSource = list;
            cb.DisplayMember = "value";
            cb.Update();
        }
开发者ID:g992com,项目名称:esb,代码行数:20,代码来源:FrmMain.cs

示例3: olvCellEditStarting

        private void olvCellEditStarting(object sender, CellEditEventArgs e)
        {
            Console.WriteLine("LKLJKLJKL");

            List<String> countries = new List<String> {"testi", "joku", "Hiiri"};

            ComboBox cboCombo = new ComboBox();
            cboCombo.Bounds = e.CellBounds;
            cboCombo.Left = e.CellBounds.Left + 1;
            cboCombo.Width = e.CellBounds.Width - 1;
            cboCombo.DropDownStyle = ComboBoxStyle.DropDownList;
            cboCombo.DisplayMember = "Display";
            cboCombo.ValueMember = "ID";
            cboCombo.DataSource = countries;
            cboCombo.AutoCompleteSource = AutoCompleteSource.ListItems;
            cboCombo.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            cboCombo.Update();
            //int intComboEditorSelectedValue = countries.Find(item => item.Display == (string)(e.Value)).ID; e.Control = cboCombo; cboCombo.SelectedValue = intComboEditorSelectedValue; //fails silently

            /*
            if (e.Column.Text != "Seura")
                return;

            ComboBox cb = new ComboBox();
            cb.Bounds = e.CellBounds;
            cb.Font = ((ObjectListView)sender).Font;
            cb.DropDownStyle = ComboBoxStyle.DropDownList;
            cb.Items.AddRange(new String[] { "Pay to eat out", "Suggest take-away", "Passable", "Seek dinner invitation", "Hire as chef" });
            cb.SelectedIndex = ((int)e.Value) / 10;
            //cb.SelectedIndexChanged += new EventHandler(cb_SelectedIndexChanged);
            cb.Tag = e.RowObject; // remember which person we are editing
            e.Control = cb;
             *
             * */
        }
开发者ID:Cubio,项目名称:Hauli,代码行数:35,代码来源:ContestantWrongInfo.cs

示例4: ComboVendedor

 public void ComboVendedor(ComboBox combobox)
 {
     combobox.DataSource = CarregaComboIDVendedor();
     combobox.ValueMember = "VEND_ID";
     combobox.DisplayMember = "FUNC_NOME";
     combobox.Update();
 }
开发者ID:AlexandreBarbosa,项目名称:ProjetoSupriMed,代码行数:7,代码来源:AgendaVisitasBLL.cs


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