本文整理汇总了C#中System.Windows.Forms.TreeView.putClientProperty方法的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.TreeView.putClientProperty方法的具体用法?C# System.Windows.Forms.TreeView.putClientProperty怎么用?C# System.Windows.Forms.TreeView.putClientProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeView
的用法示例。
在下文中一共展示了System.Windows.Forms.TreeView.putClientProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: JTreeStringTemplatePanel
//UPGRADE_TODO: Interface 'javax.swing.tree.TreeModel' was converted to 'System.Windows.Forms.TreeNode' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_3"'
//UPGRADE_TODO: Interface 'javax.swing.event.TreeSelectionListener' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095_3"'
public JTreeStringTemplatePanel(System.Windows.Forms.TreeNode tm, TreeSelectionListener listener)
{
// use a layout that will stretch tree to panel size
//UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtContainersetLayout_javaawtLayoutManager_3"'
//UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout_3"'
/*
setLayout(new BorderLayout());*/
// Create tree
tree = SupportClass.TreeSupport.CreateTreeView(tm);
// Change line style
//UPGRADE_ISSUE: Method 'javax.swing.JComponent.putClientProperty' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaxswingJComponentputClientProperty_javalangObject_javalangObject_3"'
tree.putClientProperty("JTree.lineStyle", "Angled");
// Add TreeSelectionListener
if (listener != null)
tree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(listener.valueChanged);
// Put tree in a scrollable pane's viewport
//UPGRADE_TODO: Class 'javax.swing.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_3"'
//UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaxswingJScrollPaneJScrollPane_3"'
System.Windows.Forms.ScrollableControl temp_scrollablecontrol;
temp_scrollablecontrol = new System.Windows.Forms.ScrollableControl();
temp_scrollablecontrol.AutoScroll = true;
System.Windows.Forms.ScrollableControl sp = temp_scrollablecontrol;
//UPGRADE_ISSUE: Method 'javax.swing.JScrollPane.getViewport' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaxswingJScrollPanegetViewport_3"'
//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtContaineradd_javaawtComponent_3"'
sp.getViewport().Controls.Add(tree);
//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtContaineradd_javaawtComponent_javalangObject_3"'
Controls.Add(sp);
sp.Dock = System.Windows.Forms.DockStyle.Fill;
sp.BringToFront();
}