本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}