示例#1
0
 private void Pso2optionToolTip_Popup(object sender, Leayal.Forms.ExPopupEventArgs e)
 {
     if (e.AssociatedControl is ComboBox)
     {
         e.Location = new Point(e.AssociatedControl.PointToScreen(new Point(e.AssociatedControl.Width, 0)).X, e.Location.Y);
     }
     if (e.AssociatedControl.Equals(this.pso2optionTextSize))
     {
         e.ToolTipSize = Leayal.Forms.TextRendererWrapper.WrapString(this.pso2optionToolTip.GetToolTipText(this.pso2optionTextSize), this.pso2optionToolTip.PreferedSize.Width, this.pso2optionToolTip.Font, TextFormatFlags.Left).Size;
     }
 }
        private void C_MouseEnter(object sender, EventArgs e)
        {
            System.Windows.Forms.Control c = sender as System.Windows.Forms.Control;
            if (c != null && c != this.currentControl)
            {
                this.CloseCurrentTip();
                this.currentControl = c;
                this.currentTooltip = this.SetupAnotherTip();
                var resultinfo = TextRendererWrapper.WrapString(this.innerToolTipText[c], this.PreferedSize.Width, this.Font, TextFormatFlags.Left);
                this.currentTooltip.ExTooltipText = resultinfo.Result;
                this.currentTooltip.Tag           = c;

                Point awgkaugw = System.Windows.Forms.Cursor.Position;
                awgkaugw.Offset(3, 3);

                ExPopupEventArgs arrrrgggg = new ExPopupEventArgs(this.currentTooltip, c, false, new Size(resultinfo.Size.Width + 2, resultinfo.Size.Height + 2), awgkaugw);
                this.Popup?.Invoke(this.currentTooltip, arrrrgggg);
                this.currentTooltip.ClientSize = arrrrgggg.ToolTipSize;

                this.currentTooltip.DesktopLocation = arrrrgggg.Location;
                this.currentTooltip.Opacity         = this.Opacity;
                this.ShowToolTip(this.currentTooltip);
            }
        }