當前位置: 首頁>>代碼示例>>C#>>正文


C# ToolStrip.PointToScreen方法代碼示例

本文整理匯總了C#中System.Windows.Forms.ToolStrip.PointToScreen方法的典型用法代碼示例。如果您正苦於以下問題:C# ToolStrip.PointToScreen方法的具體用法?C# ToolStrip.PointToScreen怎麽用?C# ToolStrip.PointToScreen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.ToolStrip的用法示例。


在下文中一共展示了ToolStrip.PointToScreen方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: MoveInsideContainer


//.........這裏部分代碼省略.........
         else
         {
             ToolStripPanelRow row2 = this.PointToRow(clientLocation);
             if (row2 == null)
             {
                 int count = this.RowsInternal.Count;
                 if (this.Orientation == System.Windows.Forms.Orientation.Horizontal)
                 {
                     count = (clientLocation.Y <= base.Padding.Left) ? 0 : count;
                 }
                 else
                 {
                     count = (clientLocation.X <= base.Padding.Left) ? 0 : count;
                 }
                 ToolStripPanelRow row3 = null;
                 if (this.RowsInternal.Count > 0)
                 {
                     if (count == 0)
                     {
                         row3 = this.RowsInternal[0];
                     }
                     else if (count > 0)
                     {
                         row3 = this.RowsInternal[count - 1];
                     }
                 }
                 if (((row3 != null) && (row3.ControlsInternal.Count == 1)) && row3.ControlsInternal.Contains(toolStripToDrag))
                 {
                     row2 = row3;
                     if (toolStripToDrag.IsInDesignMode)
                     {
                         Point endClientLocation = (this.Orientation == System.Windows.Forms.Orientation.Horizontal) ? new Point(clientLocation.X, row2.Bounds.Y) : new Point(row2.Bounds.X, clientLocation.Y);
                         panel.ToolStripPanelRow.MoveControl(toolStripToDrag, this.GetStartLocation(toolStripToDrag), endClientLocation);
                     }
                 }
                 else
                 {
                     row2 = new ToolStripPanelRow(this);
                     this.RowsInternal.Insert(count, row2);
                 }
             }
             else if (!row2.CanMove(toolStripToDrag))
             {
                 int index = this.RowsInternal.IndexOf(row2);
                 if (((toolStripPanelRow != null) && (toolStripPanelRow.ControlsInternal.Count == 1)) && ((index > 0) && ((index - 1) == this.RowsInternal.IndexOf(toolStripPanelRow))))
                 {
                     return;
                 }
                 row2 = new ToolStripPanelRow(this);
                 this.RowsInternal.Insert(index, row2);
                 clientLocation.Y = row2.Bounds.Y;
             }
             flag = toolStripPanelRow != row2;
             if ((!flag && (toolStripPanelRow != null)) && (toolStripPanelRow.ControlsInternal.Count > 1))
             {
                 toolStripPanelRow.LeaveRow(toolStripToDrag);
                 toolStripPanelRow = null;
                 flag = true;
             }
             if (flag)
             {
                 if (toolStripPanelRow != null)
                 {
                     toolStripPanelRow.LeaveRow(toolStripToDrag);
                 }
                 row2.JoinRow(toolStripToDrag, clientLocation);
             }
             if (flag && panel.IsCurrentlyDragging)
             {
                 for (int i = 0; i < this.RowsInternal.Count; i++)
                 {
                     LayoutTransaction.DoLayout(this.RowsInternal[i], this, PropertyNames.Rows);
                 }
                 if (this.RowsInternal.IndexOf(row2) > 0)
                 {
                     System.Windows.Forms.IntSecurity.AdjustCursorPosition.Assert();
                     try
                     {
                         Point point3 = toolStripToDrag.PointToScreen(toolStripToDrag.GripRectangle.Location);
                         if (this.Orientation == System.Windows.Forms.Orientation.Vertical)
                         {
                             point3.X += toolStripToDrag.GripRectangle.Width / 2;
                             point3.Y = Cursor.Position.Y;
                         }
                         else
                         {
                             point3.Y += toolStripToDrag.GripRectangle.Height / 2;
                             point3.X = Cursor.Position.X;
                         }
                         Cursor.Position = point3;
                     }
                     finally
                     {
                         CodeAccessPermission.RevertAssert();
                     }
                 }
             }
         }
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:101,代碼來源:ToolStripPanel.cs


注:本文中的System.Windows.Forms.ToolStrip.PointToScreen方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。