當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。