本文整理汇总了C#中System.Windows.Forms.Panel.ToScreen方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.ToScreen方法的具体用法?C# Panel.ToScreen怎么用?C# Panel.ToScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Panel
的用法示例。
在下文中一共展示了Panel.ToScreen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NotifyMouseExitVisitor
private bool NotifyMouseExitVisitor(Panel p, MouseEventArgs e)
{
Point test = new Point(e.X, e.Y);
bool update = false;
foreach(Mark m in p.Children)
{
if(m is Panel)
{
update = NotifyMouseExitVisitor(m as Panel, e) || update;
}
if(m.hovered)
{
if (!m.hitTest(test, p.ToScreen()))
{
update = m.MouseExit(p.ToScreen().untransform(test)) || update;
m.hovered = false;
}
}
}
return update;
}
示例2: DrawVisitor
public List<Tuple<Mark, Transform, RectangleF, double>> DrawVisitor(Panel p, RectangleF clip, double order)
{
List<Tuple<Mark, Transform, RectangleF, double>> result = new List<Tuple<Mark, Transform, RectangleF, double>>();
foreach (Mark m in p.Children)
{
if (m is Panel)
{
RectangleF r = m.bounds(p.ToScreen());
r.Width += 1;
r.Height += 1;
r.Intersect(clip);
result.AddRange(DrawVisitor(m as Panel, (m as Panel).Clip ? r : clip, /*order + */m.Order));
}
result.Add(new Tuple<Mark, Transform, RectangleF, double>(m, p.ToScreen(), clip, /*order + */m.Order));
}
return result;
}
示例3: NotifyMouseEnterVisitor
private bool NotifyMouseEnterVisitor(Panel p, MouseEventArgs e)
{
bool update = false;
Point test = new Point(e.X, e.Y);
foreach (Mark m in p.Children)
{
if (m is Panel)
{
if(!(m as Panel).Clip || (m as Panel).bounds(p.ToScreen()).Contains(test))
update = NotifyMouseEnterVisitor(m as Panel, e) || update;
}
if (!m.hovered)
{
if (m.hitTest(test, p.ToScreen()))
{
update = m.MouseEnter(p.ToScreen().untransform(test)) || update;
m.hovered = true;
}
}
if (m.hovered)
{
update = m.MouseOver(p.ToScreen().untransform(test)) || update;
}
}
return update;
}