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


C# ListBox.Refresh方法代码示例

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


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

示例1: refreshNeighborPanel

        /*
        private void refreshNeighborPanel(string toIgnore = null)
        {
            panelTest.Controls.Clear();

            listNeighborComboBox.Clear();
            listNeighborCheckBox.Clear();
            listNeighborButton.Clear();

            //add all the new components to the panel
            List<string> temp = featGraph.getFeatureNames();
            int counter = 0;
            for (int x = 0; x < temp.Count; x++)
            {
                if (temp[x] == toIgnore)
                {
                    counter = 1;
                    continue;
                }
                CheckBox checkBoxTemp = new CheckBox();
                checkBoxTemp.AutoSize = true;
                checkBoxTemp.Location = new System.Drawing.Point(3, 3 + (49 * (x-counter) ) );
                checkBoxTemp.Name = "checkBoxNeighbor" + x.ToString();
                checkBoxTemp.Size = new System.Drawing.Size(80, 17);
                checkBoxTemp.Text = temp[x];
                checkBoxTemp.UseVisualStyleBackColor = true;
                panelTest.Controls.Add(checkBoxTemp);
                listNeighborCheckBox.Add(checkBoxTemp);

                ComboBox comboBoxTemp = new ComboBox();
                comboBoxTemp.FormattingEnabled = true;
                comboBoxTemp.Location = new System.Drawing.Point(3, 25 + (49 * (x-counter) ) );
                comboBoxTemp.Name = "comboBoxNeighbor" + x.ToString();
                comboBoxTemp.Size = new System.Drawing.Size(141, 21);
                comboBoxTemp.Enabled = false;
                panelTest.Controls.Add(comboBoxTemp);
                listNeighborComboBox.Add(comboBoxTemp);

                Button buttonTemp = new Button();
                buttonTemp.Location = new System.Drawing.Point(150, 25 + (49 * (x-counter) ) );
                buttonTemp.Name = "buttonNeighbor" + x.ToString();
                buttonTemp.Size = new System.Drawing.Size(44, 21);
                buttonTemp.TabIndex = 13;
                buttonTemp.Text = "Add";
                buttonTemp.UseVisualStyleBackColor = true;
                buttonTemp.Enabled = false;
                panelTest.Controls.Add(buttonTemp);
                listNeighborButton.Add(buttonTemp);
            }
        }
        */
        private void refreshFeatureTagListBox(ListBox toRefresh)
        {
            toRefresh.Items.Clear();
            if (selectedIndex == -1) { toRefresh.Refresh(); return; }
            List<string> tmp = featGraph.Features[selectedIndex].getTagKeys();
            for (int x = tmp.Count-1; x >= 0; x--)
            {
                toRefresh.Items.AddRange(new object[] { tmp[x] });
            }
            toRefresh.Refresh();
        }
开发者ID:smiled0g,项目名称:ChineseDialogueSpring2015,代码行数:62,代码来源:Form1.cs

示例2: FillVariableListBox

 /// <summary>
 /// FillVariableListBox()
 /// ListBox and ComboBox both derive from ListControl
 /// According to Help file Items property of ListControl is Public.
 /// Contrary to helpfile there is no such property.
 /// So polymorphism could not be used as expected
 /// </summary>
 /// <param name="lbx">ListBox to be filled</param>
 /// <param name="scopeWord">The scope of the variable</param>
 protected void FillVariableListBox(ListBox lbx, VariableType scopeWord)
 {
     lbx.Items.Clear();
     VariableCollection vars = this.EpiInterpreter.Context.MemoryRegion.GetVariablesInScope(scopeWord);
     lbx.BeginUpdate();
     foreach (IVariable var in vars)
     {
         if (!(var is Epi.Fields.PredefinedDataField))
         {
             lbx.Items.Add(var.Name.ToString());
         }
     }
     lbx.EndUpdate();
     lbx.Sorted = true;
     lbx.Refresh();
 }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:25,代码来源:CommandDesignDialog.cs

示例3: refreshFeatureListBox

 //Helper functions to refresh listbox that contains a list of feature
 private void refreshFeatureListBox(ListBox toRefresh, string toIgnore = null)
 {
     toRefresh.Items.Clear();
     List<string> tmp = featGraph.getFeatureNames();
     for (int x = 0; x < tmp.Count; x++)
     {
         if (toIgnore != null && tmp[x] != toIgnore)
         {
             toRefresh.Items.AddRange(new object[] { tmp[x] });
         }
         else if (toIgnore == null)
         {
             toRefresh.Items.AddRange(new object[] { tmp[x] });
         }
     }
     toRefresh.Refresh();
 }
开发者ID:smiled0g,项目名称:ChineseDialogueSpring2015,代码行数:18,代码来源:Form1.cs


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