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


C# FastColoredTextBox.FindForm方法代码示例

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


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

示例1: AutocompleteListView

        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;
            BackColor = Color.White;
            MaximumSize = new Size(Size.Width, 180);
            toolTip.ShowAlways = false;
            AppearInterval = 500;
            timer.Tick += new EventHandler(timer_Tick);

            this.tb = tb;

            tb.KeyDown += new KeyEventHandler(tb_KeyDown);
            tb.SelectionChanged += new EventHandler(tb_SelectionChanged);
            tb.KeyPressed += new KeyPressEventHandler(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();
        }
开发者ID:zp-j,项目名称:CompileSpeaker,代码行数:34,代码来源:AutocompleteMenu.cs

示例2: AutocompleteListView

        internal AutocompleteListView(FastColoredTextBox tb)
        {
            Controls.Add(VerticalScrollBar);
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);
            // ReSharper disable once ConvertIfStatementToConditionalTernaryExpression
            if (HMS.PFC.Families.Length > 0) { // By WendyH
                Font = new Font(HMS.PFC.Families[0], 9.25f, FontStyle.Regular, GraphicsUnit.Point);
            } else {
                Font = new Font("Consolas", 9.75f, FontStyle.Regular, GraphicsUnit.Point);
            }
            visibleItems = new AutocompleteItems();
            VerticalScrollBar.SmallChange = ItemHeight;
            VerticalScrollBar.LargeChange = Height;
            MaximumSize     = new Size(Size.Width, ItemHeight * 10);
            ToolTip.ShowAlways = false;
            AppearInterval  = 250;
            timer.Tick     += timer_Tick;
            SelectedColor   = Color.CornflowerBlue;
            HoveredColor    = Color.Red;
            ToolTipDuration = 300000;
            this.tb = tb;
            BorderStyle = BorderStyle.None;
            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();
            };
            VScroll = false;
            HScroll = false;
            VerticalScrollBar.ValueChanged += VerticalScrollBar_Scroll;
            DoubleBuffered = true;
        }
开发者ID:WendyH,项目名称:HMSEditor_addon,代码行数:48,代码来源:AutocompleteMenu.cs

示例3: AutocompleteListView

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

            this.tb = tb;

            tb.KeyDown += new KeyEventHandler(tb_KeyDown);
            tb.SelectionChanged += new EventHandler(tb_SelectionChanged);
            tb.KeyPressed += new KeyPressEventHandler(tb_KeyPressed);

            Form form = tb.FindForm();
            if (form != null)
            {
                form.LocationChanged += delegate { SafetyClose(); };
                form.ResizeBegin += delegate { SafetyClose(); };
                form.FormClosing += delegate { SafetyClose(); };
                form.LostFocus += delegate { SafetyClose(); };
            }

            tb.LostFocus += (o, e) =>
            {
                if (Menu != null && !Menu.IsDisposed)
                    if (!Menu.Focused)
                        SafetyClose();
            };

            tb.Scroll += delegate { SafetyClose(); };

            this.VisibleChanged += (o, e) =>
            {
                if (this.Visible)
                    DoSelectedVisible();
            };
        }
开发者ID:tsovince,项目名称:V_Library,代码行数:44,代码来源:AutocompleteMenu.cs

示例4: AutocompleteListView

        internal AutocompleteListView(FastColoredTextBox tb)
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);
            if (HMS.PFC.Families.Length > 0) { // By WendyH
                base.Font = new Font(HMS.PFC.Families[0], 10f, FontStyle.Regular, GraphicsUnit.Point);
            } else {
                base.Font = new Font("Segoe UI", 9, FontStyle.Regular, GraphicsUnit.Point);
            }
            visibleItems    = new AutocompleteItems();
            VerticalScroll.SmallChange = ItemHeight;
            MaximumSize     = new Size(Size.Width, 180);
            toolTip.ShowAlways = false;
            AppearInterval  = 250;
            timer.Tick     += new EventHandler(timer_Tick);
            SelectedColor   = Color.Orange;
            HoveredColor    = Color.Red;
            ToolTipDuration = 10000;
            this.tb = tb;

            tb.KeyDown          += new KeyEventHandler(tb_KeyDown);
            tb.SelectionChanged += new EventHandler(tb_SelectionChanged);
            tb.KeyPressed       += new KeyPressEventHandler(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();

            this.VisibleChanged += (o, e) => {
                if (this.Visible)
                    DoSelectedVisible();
            };
        }
开发者ID:WendyH,项目名称:HMSEditor,代码行数:42,代码来源:AutocompleteMenu.cs


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