當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。