System.Windows.Forms.ListBox.BeginUpdate C# (CSharp) Method

BeginUpdate() public method

public BeginUpdate ( ) : void
return void
		public void BeginUpdate ()
		{
			suspend_layout = true;
		}

Usage Example

Example #1
0
 private void btnSet_Click(object sender, EventArgs e)
 {
     try
     {
         string errMsg = GenericQbItem.ValidateText(typeof(string), typeof(string), txtItem.Text);
         if (errMsg.Length != 0)
         {
             err.SetError(txtItem, errMsg);
         }
         else
         {
             try
             {
                 lstItems.BeginUpdate();
                 int idx = getSelectedItem();
                 _preventUpdate      = true;
                 lstItems.Items[idx] = ""; //force item to update, if only case has changed it won't update
                 lstItems.Items[idx] = txtItem.Text;
             }
             finally
             {
                 _preventUpdate = false;
                 lstItems.EndUpdate();
             }
         }
     }
     catch (Exception ex)
     {
         base.ShowException("Script Set Item Error", ex);
     }
 }
All Usage Examples Of System.Windows.Forms.ListBox::BeginUpdate