當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。