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


C# ListView.SetBounds方法代码示例

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


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

示例1: BeforeLabelEditTest

		public void BeforeLabelEditTest ()
		{
			Form myform = new Form ();
			myform.ShowInTaskbar = false;
			ListView mylistview = new ListView ();
			mylistview.LabelEdit = true ;
			mylistview.BeforeLabelEdit += new LabelEditEventHandler (LabelEdit_EventHandler);
			eventhandled = false;
			mylistview.View = View.Details;
			mylistview.SetBounds (10, 10, 200, 200, BoundsSpecified.All);
			mylistview.Columns.Add ("A", -2, HorizontalAlignment.Center);
			mylistview.Columns.Add ("B", -2, HorizontalAlignment.Center);
			ListViewItem item1 = new ListViewItem ("A", -1);
			mylistview.Items.Add (item1);
			myform.Controls.Add (mylistview);
			myform.ShowDialog ();
			Assert.AreEqual (true, eventhandled, "#A2");
			myform.Dispose ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:19,代码来源:ListViewEventTest.cs

示例2: 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

示例3: createTab

        private void createTab(int connection)
        {
            TabPage page = new TabPage(Properties.Settings.Default["username" + connection].ToString());

            ListView listview = new ListView();
            listview.SetBounds(6, 40, 360, 430);
            listview.Name = "lv_mails" + connection;
            listview.View = View.List;
            listview.SelectedIndexChanged += new EventHandler(mailSelectionChanged);
            page.Controls.Add(listview);

            ProgressBar progBar = new ProgressBar();
            progBar.SetBounds(6, 239, 360, 23);
            progBar.Name = "pb_progress" + connection;
            progBar.Style = ProgressBarStyle.Blocks;
            page.Controls.Add(progBar);
            progBar.BringToFront();

            Button button_compose = new Button();
            button_compose.Name = "btn_compose" + connection;
            button_compose.SetBounds(6, 10, 75, 23);
            button_compose.Text = "New mail...";
            button_compose.Click += new EventHandler(sendMailButton_Click);
            page.Controls.Add(button_compose);

            Button button_delete = new Button();
            button_delete.Name = "btn_delete" + connection;
            button_delete.SetBounds(87 ,10, 75, 23);
            button_delete.Text = "Delete mail";
            button_delete.Click += new EventHandler(deleteMail);
            page.Controls.Add(button_delete);

            GroupBox groupbox = new GroupBox();
            groupbox.Text = "Mail";
            groupbox.SetBounds(372, 34, 432, 436);
            page.Controls.Add(groupbox);

            Label label_from = new Label();
            label_from.Text = "From:";
            label_from.SetBounds(6, 22, 33, 13);
            groupbox.Controls.Add(label_from);

            Label label_to = new Label();
            label_to.Text = "To:";
            label_to.SetBounds(6, 48, 23, 13);
            groupbox.Controls.Add(label_to);

            Label label_cc = new Label();
            label_cc.Text = "CC:";
            label_cc.SetBounds(6, 74, 24, 13);
            groupbox.Controls.Add(label_cc);

            Label label_bcc = new Label();
            label_bcc.Text = "BCC:";
            label_bcc.SetBounds(218, 74, 31, 13);
            groupbox.Controls.Add(label_bcc);

            TextBox tb_from = new TextBox();
            tb_from.Name = "tb_from" + connection;
            tb_from.SetBounds(42, 19, 384, 20);
            groupbox.Controls.Add(tb_from);

            TextBox tb_to = new TextBox();
            tb_to.Name = "tb_to" + connection;
            tb_to.SetBounds(42, 45, 384, 20);
            groupbox.Controls.Add(tb_to);

            TextBox tb_cc = new TextBox();
            tb_cc.Name = "tb_cc" + connection;
            tb_cc.SetBounds(42, 71, 170, 20);
            groupbox.Controls.Add(tb_cc);

            TextBox tb_bcc = new TextBox();
            tb_bcc.Name = "tb_bcc" + connection;
            tb_bcc.SetBounds(256, 71, 170, 20);
            groupbox.Controls.Add(tb_bcc);

            TextBox tb_msg = new TextBox();
            tb_msg.Name = "tb_msg" + connection;
            tb_msg.Multiline = true;
            tb_msg.SetBounds(9, 97, 417, 333);
            groupbox.Controls.Add(tb_msg);

            tabControl1.TabPages.Add(page);
        }
开发者ID:ronnigaba,项目名称:MailClientProgrammingIV,代码行数:85,代码来源:Form1.cs

示例4: ItemDragTest

		public void ItemDragTest ()
		{
			Form myform = new Form ();
			myform.ShowInTaskbar = false;
			ListView mylistview = new ListView ();
			mylistview.ItemDrag += new ItemDragEventHandler (ItemDragEventHandler);
			mylistview.View = View.Details;
			mylistview.SetBounds (10, 10, 200, 200, BoundsSpecified.All);
			mylistview.Columns.Add ("A", -2, HorizontalAlignment.Center);
			mylistview.Columns.Add ("B", -2, HorizontalAlignment.Center);
			ListViewItem item1 = new ListViewItem ("A", -1);
			mylistview.Items.Add (item1);
			myform.Controls.Add (mylistview);
			myform.ShowDialog ();
			mylistview.Visible = true;
			mylistview.DoDragDrop (mylistview.SelectedItems, DragDropEffects.Link);
			Assert.AreEqual (true, eventhandled, "#A7");
			myform.Dispose ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:19,代码来源:ListViewEventTest.cs

示例5: ViewMatrix

 /// <summary>
 /// Hộp thoại hiển thị các cách biểu diễn của đồ thị
 /// </summary>
 /// <param name="title">Tiêu đề</param>
 /// <param name="Style">Kiểu biểu diễn</param>
 private void ViewMatrix(string title, ViewMatrixStyle Style)
 {
     Form form = new Form();
     ListView listViewMatrix = new ListView();
     Button butOK = new Button();
     listViewMatrix.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
     listViewMatrix.SetBounds(0, 0, 559, 459);
     butOK.Anchor = AnchorStyles.Bottom;
     //butOK.DialogResult = DialogResult.OK;
     butOK.SetBounds(223, 476, 112, 25);
     butOK.Text = "OK";
     form.Text = title;
     form.ClientSize = new Size(559, 508);
     form.Controls.AddRange(new Control[] { butOK, listViewMatrix });
     form.FormBorderStyle = FormBorderStyle.Sizable;
     form.StartPosition = FormStartPosition.CenterScreen;
     form.MinimizeBox = false;
     form.MaximizeBox = false;
     form.CancelButton = butOK;
     switch (Style)
     {
         case ViewMatrixStyle.vIncidenceList:
             ViewIncidenceList(GetAdjacencyMatrix(), listViewMatrix);
             break;
         case ViewMatrixStyle.vAdjacencyList:
             ViewAdjacencyList(GetAdjacencyMatrix(), listViewMatrix);
             break;
         case ViewMatrixStyle.vAdjacencyMatrix:
             ViewAdjacencyMatrix(GetAdjacencyMatrix(), listViewMatrix);
             break;
         case ViewMatrixStyle.vIncidenceMatrix:
             ViewIncidenceMatrix(GetAdjacencyMatrix(), listViewMatrix);
             break;
     }
     DialogResult dialogResult = form.ShowDialog();
     // return dialogResult;
 }
开发者ID:HoanChan,项目名称:Exams_Scheduling_Manager,代码行数:42,代码来源:Graph.cs


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