FastColoredTextBoxNS.AutocompleteListView.AutocompleteListView C# (CSharp) Method

AutocompleteListView() private method

private AutocompleteListView ( FastColoredTextBox tb ) : System
tb FastColoredTextBox
return System
        internal AutocompleteListView(FastColoredTextBox tb)
        {
            SetStyle(
                ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);
            base.Font = new Font(FontFamily.GenericSansSerif, 9);
            visibleItems = new List<AutocompleteItem>();
            itemHeight = Font.Height + 2;
            VerticalScroll.SmallChange = itemHeight;
            MaximumSize = new Size(Size.Width, 180);
            toolTip.ShowAlways = false;
            AppearInterval = 500;
            timer.Tick += timer_Tick;
            SelectedColor = Color.Orange;
            HoveredColor = Color.Red;
            ToolTipDuration = 3000;

            this.tb = tb;

            tb.KeyDown += tb_KeyDown;
            tb.SelectionChanged += tb_SelectionChanged;
            tb.KeyPressed += tb_KeyPressed;

            Form form = tb.FindForm();
            if (form != null)
            {
                form.LocationChanged += (o, e) => Menu.Close();
                form.ResizeBegin += (o, e) => Menu.Close();
                form.FormClosing += (o, e) => Menu.Close();
                form.LostFocus += (o, e) => Menu.Close();
            }

            tb.LostFocus += (o, e) => { if (!Menu.Focused) Menu.Close(); };

            tb.Scroll += (o, e) => Menu.Close();

            VisibleChanged += (o, e) =>
            {
                if (Visible)
                    DoSelectedVisible();
            };
        }