Beispiel #1
0
        /// <summary>
        /// Create the popup's content
        /// </summary>
        /// <returns>The control to add to the popup</returns>
        protected override Control CreateContent()
        {
            CustomListBox tempListBox = null;

            try
            {
                tempListBox = new CustomListBox();
                tempListBox.DropDownMouseMove    += listBox_DropDownMouseMove;
                tempListBox.SelectedIndexChanged += listBox_SelectedIndexChanged;
                tempListBox.BorderStyle           = BorderStyle.None;
                tempListBox.Dock = DockStyle.Fill;
                tempListBox.FormattingEnabled = true;
                tempListBox.Location          = new Point(0, 0);
                tempListBox.Name     = "listBox";
                tempListBox.Size     = new Size(47, 15);
                tempListBox.TabIndex = 0;

                m_listBox   = tempListBox;
                tempListBox = null;
            }
            finally
            {
                tempListBox?.Dispose();
            }
            return(m_listBox);
        }
Beispiel #2
0
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
 protected override void Dispose(bool disposing)
 {
     m_listBox.Dispose();
     base.Dispose(disposing);
 }