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


C# TreeView.SetBounds方法代码示例

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


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

示例1: InitializeComponent

        private void InitializeComponent()
        {
            _btnOK             = new Button();
            _btnCancel         = new Button();
            _btnUp             = new Button();
            _btnDown           = new Button();
            _btnAdd            = new Button();
            _btnRemove         = new Button();

            _txtType           = new TextBox();
            _tvDefinedStyles   = new TreeView();
            _lvAvailableStyles = new ListView();
            _samplePreview     = new MSHTMLHost();
            _propertyBrowser   = new PropertyGrid();
            _cntxtMenuItem     = new MenuItem();
            _cntxtMenu         = new ContextMenu();

            GroupLabel grplblStyleList = new GroupLabel();
            grplblStyleList.SetBounds(6, 5, 432, 16);
            grplblStyleList.Text = SR.GetString(SR.StylesEditorDialog_StyleListGroupLabel);
            grplblStyleList.TabStop = false;
            grplblStyleList.TabIndex = 0;

            Label lblAvailableStyles = new Label();
            lblAvailableStyles.SetBounds(14, 25, 180, 16);
            lblAvailableStyles.Text = SR.GetString(SR.StylesEditorDialog_AvailableStylesCaption);
            lblAvailableStyles.TabStop = false;
            lblAvailableStyles.TabIndex = 1;

            ColumnHeader chStyleType = new System.Windows.Forms.ColumnHeader();
            ColumnHeader chStyleNamespace = new System.Windows.Forms.ColumnHeader();

            chStyleType.Width = 16;
            chStyleType.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
            chStyleNamespace.Width = 16;
            chStyleNamespace.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;

            _lvAvailableStyles.SetBounds(14, 41, 180, 95);
            _lvAvailableStyles.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
            _lvAvailableStyles.MultiSelect = false;
            _lvAvailableStyles.HideSelection = false;
            _lvAvailableStyles.FullRowSelect = true;
            _lvAvailableStyles.View = System.Windows.Forms.View.Details;
            _lvAvailableStyles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[2] {chStyleType, chStyleNamespace});
            _lvAvailableStyles.SelectedIndexChanged += new EventHandler(this.OnNewStyleTypeChanged);
            _lvAvailableStyles.DoubleClick += new EventHandler(this.OnDoubleClick);
            _lvAvailableStyles.Sorting = SortOrder.Ascending;
            _lvAvailableStyles.TabIndex = 2;
            _lvAvailableStyles.TabStop = true;

            _btnAdd.AccessibleName = SR.GetString(SR.EditableTreeList_AddName);
            _btnAdd.AccessibleDescription = SR.GetString(SR.EditableTreeList_AddDescription);
            _btnAdd.Name = SR.GetString(SR.EditableTreeList_AddName);
            _btnAdd.SetBounds(198, 77, 32, 25);
            _btnAdd.Text = SR.GetString(SR.StylesEditorDialog_AddBtnCation);
            _btnAdd.Click += new EventHandler(this.OnClickAddButton);
            _btnAdd.TabIndex = 3;
            _btnAdd.TabStop = true;

            Label lblDefinedStyles = new Label();
            lblDefinedStyles.SetBounds(234, 25, 166, 16);
            lblDefinedStyles.Text = SR.GetString(SR.StylesEditorDialog_DefinedStylesCaption);
            lblDefinedStyles.TabStop = false;
            lblDefinedStyles.TabIndex = 4;;

            _tvDefinedStyles.SetBounds(234, 41, 166, 95);
            _tvDefinedStyles.AfterSelect += new TreeViewEventHandler(OnStylesSelected);
            _tvDefinedStyles.AfterLabelEdit += new NodeLabelEditEventHandler(OnAfterLabelEdit);
            _tvDefinedStyles.LabelEdit = true;
            _tvDefinedStyles.ShowPlusMinus = false;
            _tvDefinedStyles.HideSelection = false;
            _tvDefinedStyles.Indent = 15;
            _tvDefinedStyles.ShowRootLines = false;
            _tvDefinedStyles.ShowLines = false;
            _tvDefinedStyles.ContextMenu = _cntxtMenu;
            _tvDefinedStyles.TabIndex = 5;
            _tvDefinedStyles.TabStop = true;
            _tvDefinedStyles.KeyDown += new KeyEventHandler(OnKeyDown);
            _tvDefinedStyles.MouseUp += new MouseEventHandler(OnListMouseUp);
            _tvDefinedStyles.MouseDown += new MouseEventHandler(OnListMouseDown);

            _btnUp.AccessibleName = SR.GetString(SR.EditableTreeList_MoveUpName);
            _btnUp.AccessibleDescription = SR.GetString(SR.EditableTreeList_MoveUpDescription);
            _btnUp.Name = SR.GetString(SR.EditableTreeList_MoveUpName);
            _btnUp.SetBounds(404, 41, 28, 27);
            _btnUp.Click += new EventHandler(this.OnClickUpButton);
            _btnUp.Image = GenericUI.SortUpIcon; 
            _btnUp.TabIndex = 6;
            _btnUp.TabStop = true;

            _btnDown.AccessibleName = SR.GetString(SR.EditableTreeList_MoveDownName);
            _btnDown.AccessibleDescription = SR.GetString(SR.EditableTreeList_MoveDownDescription);
            _btnDown.Name = SR.GetString(SR.EditableTreeList_MoveDownName);
            _btnDown.SetBounds(404, 72, 28, 27);
            _btnDown.Click += new EventHandler(this.OnClickDownButton);
            _btnDown.Image = GenericUI.SortDownIcon;
            _btnDown.TabIndex = 7;
            _btnDown.TabStop = true;

            _btnRemove.AccessibleName = SR.GetString(SR.EditableTreeList_DeleteName);
//.........这里部分代码省略.........
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:101,代码来源:StylesEditorDialog.cs


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