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


C# System.Windows.Forms.TreeView.putClientProperty方法代码示例

本文整理汇总了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();
        }
开发者ID:david-mcneil,项目名称:stringtemplate,代码行数:37,代码来源:JTreeStringTemplatePanel.cs


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