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


C# Point.get_Y方法代码示例

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


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

示例1: RecalcLayout

        protected void RecalcLayout()
        {
            if (base.get_IsHandleCreated())
            {
                System.Drawing.Size size = base.Size;
                System.Drawing.Point[] pointArray = new System.Drawing.Point[3];
                System.Drawing.Point empty = System.Drawing.Point.Empty;
                System.Drawing.Point point2 = (System.Drawing.Point) size;
                switch (this.Quadrant)
                {
                    case BallonQuadrant.TopLeft:
                        empty.set_Y(TIPTAIL);
                        pointArray[2].set_X((int) (((size.get_Width() - TIPTAIL) / 4) + TIPTAIL));
                        pointArray[2].set_Y(TIPTAIL);
                        pointArray[0].set_X((int) (((size.get_Width() - TIPTAIL) / 4) + 1));
                        pointArray[0].set_Y(pointArray[2].get_Y());
                        pointArray[1].set_X(pointArray[0].get_X());
                        pointArray[1].set_Y(1);
                        break;

                    case BallonQuadrant.TopRight:
                        empty.set_Y(TIPTAIL);
                        pointArray[0].set_X((int) (((size.get_Width() - TIPTAIL) / 4) * 3));
                        pointArray[0].set_Y(TIPTAIL);
                        pointArray[2].set_X((int) (((((size.get_Width() - TIPTAIL) / 4) * 3) + TIPTAIL) - 1));
                        pointArray[2].set_Y(pointArray[0].get_Y());
                        pointArray[1].set_X(pointArray[2].get_X());
                        pointArray[1].set_Y(1);
                        break;

                    case BallonQuadrant.BottomLeft:
                        point2.set_Y((int) (size.get_Height() - TIPTAIL));
                        pointArray[0].set_X((int) ((((size.get_Width() - TIPTAIL) / 4) + TIPTAIL) - 1));
                        pointArray[0].set_Y((int) (size.get_Height() - TIPTAIL));
                        pointArray[2].set_X((int) ((size.get_Width() - TIPTAIL) / 4));
                        pointArray[2].set_Y(pointArray[0].get_Y());
                        pointArray[1].set_X(pointArray[2].get_X());
                        pointArray[1].set_Y((int) (size.get_Height() - 1));
                        break;

                    case BallonQuadrant.BottomRight:
                        point2.set_Y((int) (size.get_Height() - TIPTAIL));
                        pointArray[2].set_X((int) (((size.get_Width() - TIPTAIL) / 4) * 3));
                        pointArray[2].set_Y((int) (size.get_Height() - TIPTAIL));
                        pointArray[0].set_X((int) (((((size.get_Width() - TIPTAIL) / 4) * 3) + TIPTAIL) - 1));
                        pointArray[0].set_Y(pointArray[2].get_Y());
                        pointArray[1].set_X(pointArray[0].get_X());
                        pointArray[1].set_Y((int) (size.get_Height() - 1));
                        break;
                }
                if (pointArray[0].get_X() < TIPMARGIN)
                {
                    pointArray[0].set_X(TIPMARGIN);
                }
                if (pointArray[0].get_X() > (size.get_Width() - TIPMARGIN))
                {
                    pointArray[0].set_X((int) (size.get_Width() - TIPMARGIN));
                }
                if (pointArray[1].get_X() < TIPMARGIN)
                {
                    pointArray[1].set_X(TIPMARGIN);
                }
                if (pointArray[1].get_X() > (size.get_Width() - TIPMARGIN))
                {
                    pointArray[1].set_X((int) (size.get_Width() - TIPMARGIN));
                }
                if (pointArray[2].get_X() < TIPMARGIN)
                {
                    pointArray[2].set_X(TIPMARGIN);
                }
                if (pointArray[2].get_X() > (size.get_Width() - TIPMARGIN))
                {
                    pointArray[2].set_X((int) (size.get_Width() - TIPMARGIN));
                }
                if (!base.get_DesignMode())
                {
                    System.Drawing.Point point3 = new System.Drawing.Point((int) (this.anchorPoint.get_X() - pointArray[1].get_X()), (int) (this.anchorPoint.get_Y() - pointArray[1].get_Y()));
                    System.Drawing.Rectangle workingArea = System.Windows.Forms.Screen.FromPoint(this.anchorPoint).WorkingArea;
                    int num = 0;
                    int num2 = 0;
                    if (point3.get_X() < workingArea.get_X())
                    {
                        num = (int) (workingArea.get_Left() - point3.get_X());
                    }
                    else if ((point3.get_X() + size.get_Width()) >= workingArea.get_Right())
                    {
                        num = (int) (workingArea.get_Right() - (point3.get_X() + size.get_Width()));
                    }
                    if ((point3.get_Y() + TIPTAIL) < workingArea.get_Top())
                    {
                        num2 = (int) (workingArea.get_Top() - (point3.get_Y() + TIPTAIL));
                    }
                    else if (((point3.get_Y() + size.get_Height()) - TIPTAIL) >= workingArea.get_Bottom())
                    {
                        num2 = (int) (workingArea.get_Bottom() - ((point3.get_Y() + size.get_Height()) - TIPTAIL));
                    }
                    pointArray[1].set_X((int) (pointArray[1].get_X() - num));
                    point3.set_X((int) (point3.get_X() + num));
                    point3.set_Y((int) (point3.get_Y() + num2));
                    int introduced15 = point3.get_X();
//.........这里部分代码省略.........
开发者ID:u4097,项目名称:SQLScript,代码行数:101,代码来源:BalloonWindow.cs


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