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


C# ObjectListView.FindForm方法代码示例

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


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

示例1: Bind

        /// <summary>
        /// Attach this form to the given ObjectListView
        /// </summary>        
        public void Bind(ObjectListView olv, IOverlay overlay)
        {
            if (objectListView != null)
                Unbind();

            objectListView = olv;
            Overlay = overlay;
            mdiClient = null;
            mdiOwner = null;

            // NOTE: If you listen to any events here, you *must* stop listening in Unbind()
            if (objectListView == null)
            {
                myOwner = null;
            }
            else
            {
                objectListView.Disposed += objectListView_Disposed;
                objectListView.LocationChanged += objectListView_LocationChanged;
                objectListView.SizeChanged += objectListView_SizeChanged;
                objectListView.VisibleChanged += objectListView_VisibleChanged;
                objectListView.ParentChanged += objectListView_ParentChanged;

                Control parent = objectListView.Parent;
                while (parent != null)
                {
                    parent.ParentChanged += objectListView_ParentChanged;
                    var tabControl = parent as TabControl;
                    if (tabControl != null)
                    {
                        tabControl.Selected += tabControl_Selected;
                    }
                    parent = parent.Parent;
                }
                Owner = objectListView.FindForm();
                myOwner = Owner;
                if (Owner != null)
                {
                    Owner.LocationChanged += Owner_LocationChanged;
                    Owner.SizeChanged += Owner_SizeChanged;
                    Owner.ResizeBegin += Owner_ResizeBegin;
                    Owner.ResizeEnd += Owner_ResizeEnd;
                    if (Owner.TopMost)
                    {
                        // We can't do this.TopMost = true; since that will activate the panel,
                        // taking focus away from the owner of the listview
                        NativeMethods.MakeTopMost(this);
                    }

                    // We need special code to handle MDI
                    mdiOwner = Owner.MdiParent;
                    if (mdiOwner != null)
                    {
                        mdiOwner.LocationChanged += Owner_LocationChanged;
                        mdiOwner.SizeChanged += Owner_SizeChanged;
                        mdiOwner.ResizeBegin += Owner_ResizeBegin;
                        mdiOwner.ResizeEnd += Owner_ResizeEnd;

                        // Find the MDIClient control, which houses all MDI children
                        foreach (Control c in mdiOwner.Controls)
                        {
                            mdiClient = c as MdiClient;
                            if (mdiClient != null)
                            {
                                break;
                            }
                        }
                        if (mdiClient != null)
                        {
                            mdiClient.ClientSizeChanged += myMdiClient_ClientSizeChanged;
                        }
                    }
                }
            }
            
            UpdateTransparency();
        }
开发者ID:rxantos,项目名称:tesv-snip,代码行数:80,代码来源:GlassPanelForm.cs


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