System.Windows.Forms.ThemeWin32Classic.BalloonWindowRect C# (CSharp) Method

BalloonWindowRect() public method

public BalloonWindowRect ( System.Windows.Forms.NotifyIcon control ) : Rectangle
control System.Windows.Forms.NotifyIcon
return System.Drawing.Rectangle
		public override Rectangle BalloonWindowRect (NotifyIcon.BalloonWindow control)
		{
			Rectangle deskrect = Screen.GetWorkingArea (control);
			SizeF maxsize = new SizeF (250, 200);

			SizeF titlesize = TextRenderer.MeasureString (control.Title, control.Font, maxsize, control.Format);
			SizeF textsize = TextRenderer.MeasureString (control.Text, control.Font, maxsize, control.Format);
			
			if (titlesize.Height < balloon_iconsize)
				titlesize.Height = balloon_iconsize;
			
			Rectangle rect = new Rectangle ();
			rect.Height = (int) (titlesize.Height + textsize.Height + (3 * balloon_bordersize));
			rect.Width = (int) ((titlesize.Width > textsize.Width) ? titlesize.Width : textsize.Width) + (2 * balloon_bordersize);
			rect.X = deskrect.Width - rect.Width - 2;
			rect.Y = deskrect.Height - rect.Height - 2;
			
			return rect;
		}
		#endregion	// BalloonWindow
ThemeWin32Classic