コード例 #1
0
 public void UpdateToolTipText(string toolTipText)
 {
     System.Workflow.Interop.NativeMethods.TOOLINFO toolInfo = this.GetToolInfo();
     toolInfo.hwnd = this.parentHandle;
     toolInfo.text = Marshal.StringToBSTR(toolTipText);
     System.Workflow.Interop.NativeMethods.SendMessage(base.Handle, System.Workflow.Interop.NativeMethods.TTM_UPDATETIPTEXT, IntPtr.Zero, ref toolInfo);
 }
コード例 #2
0
 public void UpdateToolTipRectangle(Rectangle rectangle)
 {
     System.Workflow.Interop.NativeMethods.TOOLINFO toolInfo = this.GetToolInfo();
     toolInfo.hwnd        = this.parentHandle;
     toolInfo.rect.left   = rectangle.Left;
     toolInfo.rect.top    = rectangle.Top;
     toolInfo.rect.right  = rectangle.Right;
     toolInfo.rect.bottom = rectangle.Bottom;
     System.Workflow.Interop.NativeMethods.SendMessage(base.Handle, System.Workflow.Interop.NativeMethods.TTM_NEWTOOLRECT, IntPtr.Zero, ref toolInfo);
 }
コード例 #3
0
 void IDisposable.Dispose()
 {
     if (this.parentHandle != IntPtr.Zero)
     {
         System.Workflow.Interop.NativeMethods.TOOLINFO toolInfo = this.GetToolInfo();
         toolInfo.hwnd = this.parentHandle;
         this.DelTool(toolInfo);
         this.DestroyHandle();
         this.parentHandle = IntPtr.Zero;
     }
 }
コード例 #4
0
 private System.Workflow.Interop.NativeMethods.TOOLINFO GetToolInfo()
 {
     System.Workflow.Interop.NativeMethods.TOOLINFO toolinfo;
     toolinfo = new System.Workflow.Interop.NativeMethods.TOOLINFO {
         size  = Marshal.SizeOf(toolinfo),
         flags = 0,
         hwnd  = IntPtr.Zero,
         id    = IntPtr.Zero
     };
     toolinfo.rect.left = toolinfo.rect.right = toolinfo.rect.top = toolinfo.rect.bottom = 0;
     toolinfo.hinst     = IntPtr.Zero;
     toolinfo.text      = new IntPtr(-1);
     toolinfo.lParam    = IntPtr.Zero;
     return(toolinfo);
 }
コード例 #5
0
            internal NativeToolTip(IntPtr parentHandle)
            {
                this.parentHandle = parentHandle;
                CreateParams cp = new CreateParams {
                    ClassName = "tooltips_class32",
                    Style     = -2147483645,
                    ExStyle   = 8,
                    Parent    = this.parentHandle
                };

                this.CreateHandle(cp);
                if (IntPtr.Zero == base.Handle)
                {
                    throw new NullReferenceException(SR.GetString("Error_CreatingToolTip"));
                }
                System.Workflow.Interop.NativeMethods.TOOLINFO toolInfo = this.GetToolInfo();
                toolInfo.flags = 0x110;
                toolInfo.hwnd  = this.parentHandle;
                this.AddTool(toolInfo);
                this.Activate(false);
            }
コード例 #6
0
 private void DelTool(System.Workflow.Interop.NativeMethods.TOOLINFO toolInfo)
 {
     System.Workflow.Interop.NativeMethods.SendMessage(base.Handle, System.Workflow.Interop.NativeMethods.TTM_DELTOOL, IntPtr.Zero, ref toolInfo);
 }
コード例 #7
0
 private bool AddTool(System.Workflow.Interop.NativeMethods.TOOLINFO toolInfo)
 {
     return(System.Workflow.Interop.NativeMethods.SendMessage(base.Handle, System.Workflow.Interop.NativeMethods.TTM_ADDTOOL, IntPtr.Zero, ref toolInfo) != IntPtr.Zero);
 }
 private System.Workflow.Interop.NativeMethods.TOOLINFO GetToolInfo()
 {
     System.Workflow.Interop.NativeMethods.TOOLINFO toolinfo;
     toolinfo = new System.Workflow.Interop.NativeMethods.TOOLINFO {
         size = Marshal.SizeOf(toolinfo),
         flags = 0,
         hwnd = IntPtr.Zero,
         id = IntPtr.Zero
     };
     toolinfo.rect.left = toolinfo.rect.right = toolinfo.rect.top = toolinfo.rect.bottom = 0;
     toolinfo.hinst = IntPtr.Zero;
     toolinfo.text = new IntPtr(-1);
     toolinfo.lParam = IntPtr.Zero;
     return toolinfo;
 }