Exemplo n.º 1
0
        internal static void PositionTooltip(Control parent, GridToolTip ToolTip, Rectangle itemRect) {
            ToolTip.Visible = false;
            
            NativeMethods.RECT rect = NativeMethods.RECT.FromXYWH(itemRect.X, itemRect.Y, itemRect.Width, itemRect.Height);

            ToolTip.SendMessage(NativeMethods.TTM_ADJUSTRECT, 1, ref rect);

            // now offset it back to screen coords
            Point locPoint = parent.PointToScreen(new Point(rect.left, rect.top));
            
            ToolTip.Location = locPoint;   // set the position once so it updates it's size with it's real width.
            
            int overHang =  (ToolTip.Location.X + ToolTip.Size.Width) - SystemInformation.VirtualScreen.Width;
            if (overHang > 0) {
                locPoint.X -= overHang;
                ToolTip.Location = locPoint;
            }

            // tell the control we've repositioned it.
            ToolTip.Visible = true;  
        }
Exemplo n.º 2
0
 protected override void OnHandleDestroyed(EventArgs e) {
     SystemEvents.UserPreferenceChanged -= new UserPreferenceChangedEventHandler(this.OnSysColorChange);
     // We can leak this if we aren't disposed.
     //
     if (toolTip != null && !RecreatingHandle) {
         toolTip.Dispose();
         toolTip = null;
     }
     base.OnHandleDestroyed(e);
 }
Exemplo n.º 3
0
        protected override void Dispose(bool disposing) {
            if (disposing) {
                Debug.WriteLineIf(CompModSwitches.DebugGridView.TraceVerbose,  "PropertyGridView:Dispose");
                if (scrollBar != null) scrollBar.Dispose();
                if (listBox != null) listBox.Dispose();
                if (dropDownHolder != null) dropDownHolder.Dispose();
                scrollBar = null;
                listBox = null;
                dropDownHolder = null;

                ownerGrid = null;
                topLevelGridEntries = null;
                allGridEntries = null;
                serviceProvider = null;
                
                topHelpService = null;

                if (helpService != null && helpService is IDisposable)
                    ((IDisposable)helpService).Dispose();

                helpService = null;

                if (edit != null) {
                    edit.Dispose();
                    edit = null;
                }

                if (fontBold != null) {
                    fontBold.Dispose();
                    fontBold = null;

                }

                if (btnDropDown != null) {
                    btnDropDown.Dispose();
                    btnDropDown = null;
                }

                if (btnDialog != null) {
                    btnDialog.Dispose();
                    btnDialog = null;
                }

                if (toolTip != null) {
                    toolTip.Dispose();
                    toolTip = null;
                }
            }

            base.Dispose(disposing);
        }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.scrollBar != null)
         {
             this.scrollBar.Dispose();
         }
         if (this.listBox != null)
         {
             this.listBox.Dispose();
         }
         if (this.dropDownHolder != null)
         {
             this.dropDownHolder.Dispose();
         }
         this.scrollBar = null;
         this.listBox = null;
         this.dropDownHolder = null;
         this.ownerGrid = null;
         this.topLevelGridEntries = null;
         this.allGridEntries = null;
         this.serviceProvider = null;
         this.topHelpService = null;
         if ((this.helpService != null) && (this.helpService is IDisposable))
         {
             ((IDisposable) this.helpService).Dispose();
         }
         this.helpService = null;
         if (this.edit != null)
         {
             this.edit.Dispose();
             this.edit = null;
         }
         if (this.fontBold != null)
         {
             this.fontBold.Dispose();
             this.fontBold = null;
         }
         if (this.btnDropDown != null)
         {
             this.btnDropDown.Dispose();
             this.btnDropDown = null;
         }
         if (this.btnDialog != null)
         {
             this.btnDialog.Dispose();
             this.btnDialog = null;
         }
         if (this.toolTip != null)
         {
             this.toolTip.Dispose();
             this.toolTip = null;
         }
     }
     base.Dispose(disposing);
 }
 internal static void PositionTooltip(Control parent, GridToolTip ToolTip, Rectangle itemRect)
 {
     ToolTip.Visible = false;
     System.Windows.Forms.NativeMethods.RECT lparam = System.Windows.Forms.NativeMethods.RECT.FromXYWH(itemRect.X, itemRect.Y, itemRect.Width, itemRect.Height);
     ToolTip.SendMessage(0x41f, 1, ref lparam);
     Point point = parent.PointToScreen(new Point(lparam.left, lparam.top));
     ToolTip.Location = point;
     int num = (ToolTip.Location.X + ToolTip.Size.Width) - SystemInformation.VirtualScreen.Width;
     if (num > 0)
     {
         point.X -= num;
         ToolTip.Location = point;
     }
     ToolTip.Visible = true;
 }
 protected override void OnHandleDestroyed(EventArgs e)
 {
     SystemEvents.UserPreferenceChanged -= new UserPreferenceChangedEventHandler(this.OnSysColorChange);
     if ((this.toolTip != null) && !base.RecreatingHandle)
     {
         this.toolTip.Dispose();
         this.toolTip = null;
     }
     base.OnHandleDestroyed(e);
 }