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


C# TreeNode.GetY方法代码示例

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


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

示例1: CollapseBelow

		internal void CollapseBelow (TreeNode node, int count_to_next)
		{
			if (update_stack > 0) {
				update_needed = true;
				return;
			}

			Rectangle below = new Rectangle (0, node.Bounds.Bottom, ViewportRectangle.Width,
					ViewportRectangle.Height - node.Bounds.Bottom);

			int amount = count_to_next * ActualItemHeight;

			if (amount > 0)
				XplatUI.ScrollWindow (Handle, below, 0, -amount, false);

			if (show_plus_minus) {
				Invalidate (new Rectangle (0, node.GetY (), Width, ActualItemHeight));
			}
		}
开发者ID:ileonchik,项目名称:mono,代码行数:19,代码来源:TreeView.cs

示例2: DrawTreeNode

		private void DrawTreeNode (TreeNode node, Graphics dc, Rectangle clip)
		{
			int child_count = node.nodes.Count;
			int y = node.GetY ();
			int middle = y + (ActualItemHeight / 2);

			if (full_row_select && !show_lines) {
				Rectangle r = new Rectangle (1, y, ViewportRectangle.Width - 2, ActualItemHeight);
				DrawSelectionAndFocus (node, dc, r);
			}

			if (draw_mode == TreeViewDrawMode.Normal || draw_mode == TreeViewDrawMode.OwnerDrawText) {
				if ((show_root_lines || node.Parent != null) && show_plus_minus && child_count > 0)
					ThemeEngine.Current.TreeViewDrawNodePlusMinus (this, node, dc, node.GetLinesX () - Indent + 5, middle);

				if (checkboxes && state_image_list == null)
					DrawNodeCheckBox (node, dc, CheckBoxLeft (node) - 3, middle);

				if (checkboxes && state_image_list != null)
					DrawNodeState (node, dc, CheckBoxLeft (node) - 3, y);

				if (!checkboxes && node.StateImage != null)
					dc.DrawImage (node.StateImage, new Rectangle (CheckBoxLeft (node) - 3, y, 16, 16));

				if (show_lines)
					DrawNodeLines (node, dc, clip, dash, node.GetLinesX (), y, middle);

				if (ImageList != null)
					DrawNodeImage (node, dc, clip, node.GetImageX (), y);
			}

			if (draw_mode != TreeViewDrawMode.Normal) {
				dc.FillRectangle (Brushes.White, node.Bounds);
				TreeNodeStates tree_node_state = TreeNodeStates.Default;;
				if (node.IsSelected)
					tree_node_state = TreeNodeStates.Selected;
				if (node.Checked)
					tree_node_state |= TreeNodeStates.Checked;
				if (node == focused_node)
					tree_node_state |= TreeNodeStates.Focused;
				Rectangle node_bounds = node.Bounds;
				if (draw_mode == TreeViewDrawMode.OwnerDrawText) {
					node_bounds.X += 3;
					node_bounds.Y += 1;
				} else {
					node_bounds.X = 0;
					node_bounds.Width = Width;
				}

				DrawTreeNodeEventArgs e = new DrawTreeNodeEventArgs (dc, node, node_bounds, tree_node_state);

				OnDrawNode (e);				
				if (!e.DrawDefault)
					return;
			}

			if (!node.IsEditing)
				DrawStaticNode (node, dc);
		}
开发者ID:ileonchik,项目名称:mono,代码行数:59,代码来源:TreeView.cs

示例3: ExpandBelow

		internal void ExpandBelow (TreeNode node, int count_to_next)
		{
			if (update_stack > 0) {
				update_needed = true;
				return;
			}

			// If node Bottom is less than 0, the node is above and not visible,
			// and we need to scroll the entire viewport
			int node_bottom = node.Bounds.Bottom >= 0 ? node.Bounds.Bottom : 0;
			Rectangle below = new Rectangle (0, node_bottom, ViewportRectangle.Width,
					ViewportRectangle.Height - node_bottom);

			int amount = count_to_next * ActualItemHeight;

			if (amount > 0)
				XplatUI.ScrollWindow (Handle, below, 0, amount, false);

			if (show_plus_minus) {
				Invalidate (new Rectangle (0, node.GetY (), Width, ActualItemHeight));
			}
		}
开发者ID:ileonchik,项目名称:mono,代码行数:22,代码来源:TreeView.cs

示例4: TreeViewDrawNodePlusMinus

		public override void TreeViewDrawNodePlusMinus (TreeView treeView, TreeNode node, Graphics dc, int x, int middle)
		{
			int height = treeView.ActualItemHeight - 2;
			dc.FillRectangle (ResPool.GetSolidBrush (treeView.BackColor), (x + 4) - (height / 2), node.GetY() + 1, height, height);
			
			dc.DrawRectangle (SystemPens.ControlDarkDark, x, middle - 4, 8, 8);

			if (node.IsExpanded) {
				dc.DrawLine (SystemPens.ControlDarkDark, x + 2, middle, x + 6, middle); 
			} else {
				dc.DrawLine (SystemPens.ControlDarkDark, x + 2, middle, x + 6, middle);
				dc.DrawLine (SystemPens.ControlDarkDark, x + 4, middle - 2, x + 4, middle + 2);
			}
		}
开发者ID:ngraziano,项目名称:mono,代码行数:14,代码来源:ThemeWin32Classic.cs


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