当前位置: 首页>>代码示例>>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;未经允许,请勿转载。