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


C# VisualStyleRenderer.GetBackgroundRegion方法代码示例

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


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

示例1: GetRegion

 public override Region GetRegion(Graphics dc, Rectangle rect)
 {
     Region ret;
     if (IsDefined(VisualStyleElement.ToolTip.Balloon.Normal))
     {
         VisualStyleRenderer renderer = new VisualStyleRenderer(VisualStyleElement.ToolTip.Balloon.Normal);
         ret = renderer.GetBackgroundRegion(dc, rect);
     }
     else
         ret = new Region(rect);
     return ret;
 }
开发者ID:fiftin,项目名称:WinFormsPopupAlerts,代码行数:12,代码来源:SystemTooltipAlertRenderer.cs

示例2: ManagedWindowGetWindowRegion

		Region ManagedWindowGetWindowRegion (Form form)
		{
			if (form.WindowManager is MdiWindowManager && form.WindowManager.IsMaximized)
				return null;
			VisualStyleElement title_bar_element = ManagedWindowGetTitleBarVisualStyleElement (form.WindowManager);
			if (!VisualStyleRenderer.IsElementDefined (title_bar_element))
				return null;
			VisualStyleRenderer renderer = new VisualStyleRenderer (title_bar_element);
			if (!renderer.IsBackgroundPartiallyTransparent ())
				return null;
			IDeviceContext dc = GetMeasurementDeviceContext ();
			Rectangle title_bar_rectangle = ManagedWindowGetTitleBarRectangle (form.WindowManager);
			Region region = renderer.GetBackgroundRegion (dc, title_bar_rectangle);
			ReleaseMeasurementDeviceContext (dc);
			region.Union (new Rectangle (0, title_bar_rectangle.Bottom, form.Width, form.Height));
			return region;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:17,代码来源:ThemeVisualStyles.cs

示例3: method_0

		public void method_0(Point point, string text)
		{
			_toolTip.Text = text;
			var size = Size.Ceiling(_toolTip.method_0(text));
			size.Height += 4;
			size.Width += 4;
			point.Y += 19;
			var screen = Screen.FromPoint(point);
		    if (point.X < screen.Bounds.Left)
		        point.X = screen.Bounds.Left;
		    if (point.X + size.Width > screen.Bounds.Right)
			{
				point.X = screen.Bounds.Right - size.Width;
				if (point.X < screen.Bounds.Left)
				{
					return;
				}
			}
			if (point.Y < screen.Bounds.Top)
			{
				point.Y = screen.Bounds.Top;
			}
			if (point.Y + size.Height > screen.Bounds.Bottom)
			{
				point.Y = screen.Bounds.Bottom - size.Height;
				if (point.Y < screen.Bounds.Top)
				{
					return;
				}
				point.X++;
			}
			Native.SetWindowPos(_toolTip.Handle, new IntPtr(-1), point.X, point.Y, size.Width, size.Height, 80);
			var normal = VisualStyleElement.ToolTip.Standard.Normal;
			if (Application.RenderWithVisualStyles && VisualStyleRenderer.IsElementDefined(normal))
			{
				var renderer = new VisualStyleRenderer(normal);
			    using (var g = _toolTip.CreateGraphics())
			        _toolTip.Region = renderer.GetBackgroundRegion(g, _toolTip.ClientRectangle);
			}
			_toolTip.Invalidate();
			_tooltipShown = true;
		    if (_ownerForm != null)
		        _ownerForm.Deactivate -= OnFormDeactivate;
		    _ownerForm = FindTopContainingForm(_control);
		    if (_ownerForm == null) return;
		    _ownerForm.Deactivate += OnFormDeactivate;
		    _toolTip.Owner = _ownerForm;
		}
开发者ID:javagg,项目名称:DemoDock,代码行数:48,代码来源:ToolTips.cs

示例4: GetRegion

 public static Region GetRegion(IDeviceContext dc, Size minSize, Size maxSize, string title, string text, ToolTipIcon icon, Padding padding)
 {
     Region ret;
     Rectangle titleRect;
     Rectangle rect = GetRect(dc, minSize, maxSize, title, text, out titleRect, icon, padding);
     if (Application.RenderWithVisualStyles)
     {
         VisualStyleRenderer renderer = new VisualStyleRenderer(VisualStyleElement.ToolTip.Balloon.Normal);
         ret = renderer.GetBackgroundRegion(dc, rect);
     }
     else
     {
         throw new NotImplementedException();
     }
     return ret;
 }
开发者ID:fiftin,项目名称:WinFormsPopupAlerts,代码行数:16,代码来源:ToolTipBalloonDrawingHelper.cs


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