• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Forms.ListBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



System.Windows.Forms.ListBox类属于命名空间,在下文中一共展示了System.Windows.Forms.ListBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InitializeComponent

		/// <summary>
		/// This method is required for Windows Forms designer support.
		/// Do not change the method contents inside the source code editor. The Forms designer might
		/// not be able to load this method if it was changed manually.
		/// </summary>
		private void InitializeComponent()
		{
			this.lbLog = new System.Windows.Forms.ListBox();
			this.SuspendLayout();
			// 
			// lbLog
			// 
			this.lbLog.Dock = System.Windows.Forms.DockStyle.Fill;
			this.lbLog.FormattingEnabled = true;
			this.lbLog.Location = new System.Drawing.Point(0, 0);
			this.lbLog.Name = "lbLog";
			this.lbLog.Size = new System.Drawing.Size(361, 409);
			this.lbLog.TabIndex = 1;
			// 
			// dfmReport
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(361, 409);
			this.Controls.Add(this.lbLog);
			this.Name = "dfmReport";
			this.Text = "log";
			this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DfmReportFormClosing);
			this.Load += new System.EventHandler(this.DfmReportLoad);
			this.ResumeLayout(false);

		}
开发者ID:emm274,项目名称:fcObj,代码行数:32,代码来源:dfmReport.Designer.cs


示例2: EditValue

 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     List<string> lstToSel = this.GetListToSelect(context);
     IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
     if (service != null)
     {
         System.Windows.Forms.ListBox lst = new System.Windows.Forms.ListBox();
         lst.Click += delegate(object sender, EventArgs e)
         {
             service.CloseDropDown();
         };
         // 选中原有值
         int iPos = -1;
         foreach (string s in lstToSel)
         {
             int i = lst.Items.Add(s);
             if (s.Equals(value)) iPos = i;
         }
         if (iPos != -1) lst.SelectedIndex = iPos;
         // 下拉
         service.DropDownControl(lst);
         if (lst.SelectedItem != null)
             value = lst.SelectedItem.ToString();
         else
             value = "";
     }
     return value;
 }
开发者ID:san90279,项目名称:UK_OAS,代码行数:28,代码来源:BaseEditor.cs


示例3: InitializeComponent

 /// <summary>
 /// 设计器支持所需的方法 - 不要
 /// 使用代码编辑器修改此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     this.listBox1 = new System.Windows.Forms.ListBox();
     this.SuspendLayout();
     //
     // listBox1
     //
     this.listBox1.FormattingEnabled = true;
     this.listBox1.ItemHeight = 12;
     this.listBox1.Location = new System.Drawing.Point(0, 3);
     this.listBox1.Name = "listBox1";
     this.listBox1.Size = new System.Drawing.Size(282, 88);
     this.listBox1.TabIndex = 0;
     //
     // Frm_Main
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(284, 93);
     this.Controls.Add(this.listBox1);
     this.Name = "Frm_Main";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "C#中实现文件拖放";
     this.Load += new System.EventHandler(this.Form1_Load);
     this.DragEnter += new System.Windows.Forms.DragEventHandler(this.Form1_DragEnter);
     this.ResumeLayout(false);
 }
开发者ID:TGHGH,项目名称:C-1200,代码行数:31,代码来源:Frm_Main.designer.cs


示例4: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.btnDelete = new System.Windows.Forms.Button();
     this.btnEdit = new System.Windows.Forms.Button();
     this.btnAdd = new System.Windows.Forms.Button();
     this.lbDetails = new System.Windows.Forms.ListBox();
     this.SuspendLayout();
     //
     // btnDelete
     //
     this.btnDelete.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
     this.btnDelete.Location = new System.Drawing.Point(374, 346);
     this.btnDelete.Name = "btnDelete";
     this.btnDelete.Size = new System.Drawing.Size(91, 23);
     this.btnDelete.TabIndex = 10;
     this.btnDelete.Text = "Delete";
     this.btnDelete.UseVisualStyleBackColor = true;
     //
     // btnEdit
     //
     this.btnEdit.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
     this.btnEdit.Location = new System.Drawing.Point(277, 346);
     this.btnEdit.Name = "btnEdit";
     this.btnEdit.Size = new System.Drawing.Size(91, 23);
     this.btnEdit.TabIndex = 9;
     this.btnEdit.Text = "Edit";
     this.btnEdit.UseVisualStyleBackColor = true;
     //
     // btnAdd
     //
     this.btnAdd.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
     this.btnAdd.Location = new System.Drawing.Point(180, 346);
     this.btnAdd.Name = "btnAdd";
     this.btnAdd.Size = new System.Drawing.Size(91, 23);
     this.btnAdd.TabIndex = 8;
     this.btnAdd.Text = "Add";
     this.btnAdd.UseVisualStyleBackColor = true;
     //
     // lbDetails
     //
     this.lbDetails.FormattingEnabled = true;
     this.lbDetails.Location = new System.Drawing.Point(12, 18);
     this.lbDetails.Name = "lbDetails";
     this.lbDetails.Size = new System.Drawing.Size(624, 316);
     this.lbDetails.TabIndex = 7;
     //
     // FormDetails
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(648, 372);
     this.Controls.Add(this.btnDelete);
     this.Controls.Add(this.btnEdit);
     this.Controls.Add(this.btnAdd);
     this.Controls.Add(this.lbDetails);
     this.MinimizeBox = false;
     this.Name = "FormDetails";
     this.Text = "FormDetails";
     this.ResumeLayout(false);
 }
开发者ID:AlanWills,项目名称:Mythology,代码行数:64,代码来源:FormDetails.designer.cs


示例5: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.lstProducts = new System.Windows.Forms.ListBox();
     this.btnExit = new System.Windows.Forms.Button();
     this.btnDelete = new System.Windows.Forms.Button();
     this.btnAdd = new System.Windows.Forms.Button();
     this.SuspendLayout();
     //
     // lstProducts
     //
     this.lstProducts.FormattingEnabled = true;
     this.lstProducts.Location = new System.Drawing.Point(12, 12);
     this.lstProducts.Name = "lstProducts";
     this.lstProducts.Size = new System.Drawing.Size(352, 160);
     this.lstProducts.TabIndex = 10;
     //
     // btnExit
     //
     this.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.btnExit.Location = new System.Drawing.Point(380, 76);
     this.btnExit.Name = "btnExit";
     this.btnExit.Size = new System.Drawing.Size(104, 24);
     this.btnExit.TabIndex = 9;
     this.btnExit.Text = "E&xit";
     this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
     //
     // btnDelete
     //
     this.btnDelete.Location = new System.Drawing.Point(380, 44);
     this.btnDelete.Name = "btnDelete";
     this.btnDelete.Size = new System.Drawing.Size(104, 24);
     this.btnDelete.TabIndex = 8;
     this.btnDelete.Text = "Delete Product...";
     this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
     //
     // btnAdd
     //
     this.btnAdd.Location = new System.Drawing.Point(380, 12);
     this.btnAdd.Name = "btnAdd";
     this.btnAdd.Size = new System.Drawing.Size(104, 24);
     this.btnAdd.TabIndex = 7;
     this.btnAdd.Text = "Add Product...";
     this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
     //
     // frmProductMain
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.CancelButton = this.btnExit;
     this.ClientSize = new System.Drawing.Size(502, 181);
     this.Controls.Add(this.lstProducts);
     this.Controls.Add(this.btnExit);
     this.Controls.Add(this.btnDelete);
     this.Controls.Add(this.btnAdd);
     this.Name = "frmProductMain";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "Product Maintenance";
     this.Load += new System.EventHandler(this.frmProductMain_Load);
     this.ResumeLayout(false);
 }
开发者ID:fakeshark,项目名称:CSharpProjects,代码行数:64,代码来源:frmProductMain.designer.cs


示例6: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.listBox1 = new System.Windows.Forms.ListBox();
     this.SuspendLayout();
     //
     // listBox1
     //
     this.listBox1.FormattingEnabled = true;
     this.listBox1.Items.AddRange(new object[] {
     "Bệnh viện 30/4",
     "Bệnh viện 115",
     "Bệnh viện Thống Nhất"});
     this.listBox1.Location = new System.Drawing.Point(22, 44);
     this.listBox1.Name = "listBox1";
     this.listBox1.Size = new System.Drawing.Size(352, 173);
     this.listBox1.TabIndex = 0;
     this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(400, 262);
     this.Controls.Add(this.listBox1);
     this.Name = "Form1";
     this.Text = "Đặt lịch khám";
     this.Load += new System.EventHandler(this.Form1_Load);
     this.ResumeLayout(false);
 }
开发者ID:tunhuh95,项目名称:VSEE,代码行数:33,代码来源:HospitalListBooking.designer.cs


示例7: EditValue

		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			Reference retval = null;
			try
			{
				edSvc = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));

				var table = (Table)context.Instance;
				var root = (ModelRoot)table.Root;
				var referenceCollection = table.Columns;

				//Create the list box 
				var newBox = new System.Windows.Forms.ListBox();
				newBox.Click += new EventHandler(newBox_Click);
				newBox.IntegralHeight = false;

				newBox.Items.Add("(Not Set)");
				foreach(Reference reference in referenceCollection)
				{
					var column = ((ModelRoot)reference.Root).Database.Columns.GetById(reference.Ref)[0];
					newBox.Items.Add(column);
				}

				edSvc.DropDownControl(newBox);
				if((newBox.SelectedIndex > 0) && (newBox.SelectedItem != null))
					retval = ((Column)newBox.SelectedItem).CreateRef();

			}
			catch(Exception ex) { }
			return retval;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:31,代码来源:ColumnSingleSelectEditor.cs


示例8: InitializeComponent

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.lbContacts = new System.Windows.Forms.ListBox();
            this.label1 = new System.Windows.Forms.Label();
            this.btnStartChat = new System.Windows.Forms.Button();
            this.chatCheckTimer = new System.Windows.Forms.Timer(this.components);
            this.SuspendLayout();
            // 
            // lbContacts
            // 
            this.lbContacts.FormattingEnabled = true;
            this.lbContacts.Location = new System.Drawing.Point(12, 25);
            this.lbContacts.Name = "lbContacts";
            this.lbContacts.Size = new System.Drawing.Size(207, 290);
            this.lbContacts.TabIndex = 0;
            this.lbContacts.SelectedIndexChanged += new System.EventHandler(this.lbContacts_SelectedIndexChanged);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(12, 9);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(49, 13);
            this.label1.TabIndex = 1;
            this.label1.Text = "Contacts";
            // 
            // btnStartChat
            // 
            this.btnStartChat.Location = new System.Drawing.Point(225, 25);
            this.btnStartChat.Name = "btnStartChat";
            this.btnStartChat.Size = new System.Drawing.Size(106, 23);
            this.btnStartChat.TabIndex = 2;
            this.btnStartChat.Text = "Start Chat";
            this.btnStartChat.UseVisualStyleBackColor = true;
            this.btnStartChat.Click += new System.EventHandler(this.btnStartChat_Click);
            // 
            // chatCheckTimer
            // 
            this.chatCheckTimer.Enabled = true;
            this.chatCheckTimer.Interval = 2000;
            this.chatCheckTimer.Tick += new System.EventHandler(this.chatCheckTimer_Tick);
            // 
            // HoofdForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(340, 327);
            this.Controls.Add(this.btnStartChat);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.lbContacts);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.Name = "HoofdForm";
            this.Text = "HoofdForm";
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.HoofdForm_FormClosing);
            this.ResumeLayout(false);
            this.PerformLayout();

        }
开发者ID:kndschilders,项目名称:Profchat,代码行数:64,代码来源:HoofdForm.Designer.cs


示例9: EditValue

		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			var retval = System.Data.SqlDbType.VarChar;
			try
			{
				edSvc = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));

				var column = (ColumnBase)context.Instance;
				retval = column.DataType;

				//Create the list box
				var newBox = new System.Windows.Forms.ListBox();
				newBox.Click += new EventHandler(newBox_Click);
				newBox.IntegralHeight = false;

				var values = new List<string>();
				foreach (var t in Enum.GetNames(typeof(System.Data.SqlDbType)).OrderBy(x => x))
				{
					values.Add(t);
				}

				newBox.Items.AddRange(values.ToArray());
				newBox.SelectedIndex = newBox.FindString(column.DataType.ToString());

				edSvc.DropDownControl(newBox);
				if ((column != null) && (newBox.SelectedIndex != -1))
					retval = (System.Data.SqlDbType)Enum.Parse(typeof(System.Data.SqlDbType), values[newBox.SelectedIndex]);

			}
			catch (Exception ex) { }
			return retval;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:32,代码来源:DataTypeEditor.cs


示例10: EditValue

		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			var retval = false;
			try
			{
				edSvc = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));

				var column = (ColumnBase)context.Instance;
				retval = column.AllowNull;

				//Create the list box
				var newBox = new System.Windows.Forms.ListBox();
				newBox.Click += new EventHandler(newBox_Click);
				newBox.IntegralHeight = false;

				var values = new List<string>();
				values.Add(false.ToString()); 
				values.Add(true.ToString());

				newBox.Items.AddRange(values.ToArray());
				newBox.SelectedIndex = (column.AllowNull ? 1 : 0);

				edSvc.DropDownControl(newBox);
				if ((column != null) && (newBox.SelectedIndex != -1))
					retval = (newBox.SelectedIndex == 0 ? false : true);

			}
			catch (Exception ex) { }
			return retval;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:30,代码来源:AllowNullEditor.cs


示例11: EditValue

		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			var retval = Guid.Empty;
			try
			{
				edSvc = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));

				var moduleRule = context.Instance as ModuleRule;
				var modulelist = moduleRule.Module.nHydrateModel.Modules.OrderBy(x => x.Name).Where(x => x.Id != moduleRule.Module.Id).ToList();
				var selected = modulelist.FirstOrDefault(x=>x.Id == moduleRule.DependentModule); 

				//Create the list box
				var newBox = new System.Windows.Forms.ListBox();
				newBox.Click += new EventHandler(newBox_Click);
				newBox.IntegralHeight = false;

				var values = new List<string>();
				values.Add(false.ToString());
				values.Add(true.ToString());

				newBox.Items.AddRange(modulelist.Select(x => x.Name).ToArray());
				if (selected != null)
					newBox.SelectedIndex = modulelist.IndexOf(selected);

				edSvc.DropDownControl(newBox);
				if ((moduleRule != null) && (newBox.SelectedIndex != -1))
					retval = modulelist[newBox.SelectedIndex].Id;

			}
			catch (Exception ex) { }
			return retval;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:32,代码来源:ModuleEditor.cs


示例12: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.listBox1 = new System.Windows.Forms.ListBox();
     this.SuspendLayout();
     //
     // listBox1
     //
     this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     | System.Windows.Forms.AnchorStyles.Left)
     | System.Windows.Forms.AnchorStyles.Right)));
     this.listBox1.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.listBox1.FormattingEnabled = true;
     this.listBox1.ItemHeight = 14;
     this.listBox1.Location = new System.Drawing.Point(0, 0);
     this.listBox1.Name = "listBox1";
     this.listBox1.Size = new System.Drawing.Size(216, 158);
     this.listBox1.TabIndex = 0;
     //
     // StackFrameView
     //
     this.ClientSize = new System.Drawing.Size(219, 161);
     this.CloseButton = false;
     this.CloseButtonVisible = false;
     this.Controls.Add(this.listBox1);
     this.HideOnClose = true;
     this.MaximizeBox = false;
     this.MinimizeBox = false;
     this.MinimumSize = new System.Drawing.Size(235, 200);
     this.Name = "StackFrameView";
     this.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
     this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockLeft;
     this.TabText = "Stack Frame";
     this.Text = "Stack Frame";
     this.ResumeLayout(false);
 }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:39,代码来源:StackFrameView.designer.cs


示例13: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.listBox1 = new System.Windows.Forms.ListBox();
     this.SuspendLayout();
     //
     // listBox1
     //
     this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     | System.Windows.Forms.AnchorStyles.Left)
     | System.Windows.Forms.AnchorStyles.Right)));
     this.listBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.listBox1.FormattingEnabled = true;
     this.listBox1.ItemHeight = 16;
     this.listBox1.Location = new System.Drawing.Point(1, 0);
     this.listBox1.Name = "listBox1";
     this.listBox1.Size = new System.Drawing.Size(284, 256);
     this.listBox1.TabIndex = 0;
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(282, 253);
     this.Controls.Add(this.listBox1);
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name = "Form1";
     this.Opacity = 0.01D;
     this.ShowInTaskbar = false;
     this.Text = "VitratF";
     this.ResumeLayout(false);
 }
开发者ID:vdandrade,项目名称:VitratF,代码行数:36,代码来源:Form1.Designer+(Cópia+em+conflito+de+ADMV+2015-08-30).cs


示例14: EditValue

 /// <summary>
 /// Overrides the method used to provide basic behaviour for selecting editor.
 /// Shows our custom control for editing the value.
 /// </summary>
 /// <param name="context">The context of the editing control</param>
 /// <param name="provider">A valid service provider</param>
 /// <param name="value">The current value of the object to edit</param>
 /// <returns>The new value of the object</returns>
 public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (context == null || context.Instance == null || provider == null)
     {
         return base.EditValue(context, provider, value);
     }
     if ((m_EdSvc = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService))) == null)
     {
         return value;
     }
     // Create a CheckedListBox and populate it with all the propertylist values
     m_List = new System.Windows.Forms.ListBox();
     m_List.BorderStyle = System.Windows.Forms.BorderStyle.None;
     foreach (GXCategory cat in (context.Instance as GXKeepalive).Parent.Categories)
     {
         foreach (GXProperty prop in cat.Properties)
         {
             m_List.Items.Add(prop);
         }
     }
     if (value != null)
     {
         m_List.SelectedIndex = m_List.Items.IndexOf(value);
     }
     m_List.SelectedIndexChanged += new System.EventHandler(this.OnSelectedIndexChanged);
     // Show Listbox as a DropDownControl. This methods returns only when the dropdowncontrol is closed
     m_EdSvc.DropDownControl(m_List);
     (context.Instance as GXKeepalive).Target = m_List.SelectedItem;
     return value;
 }
开发者ID:giapdangle,项目名称:Gurux.Device,代码行数:38,代码来源:GXKeepaliveEditor.cs


示例15: HandlePluginLaunch

        private void HandlePluginLaunch(object sender, EventArgs e)
        {
            //NWN2Toolset.NWN2.Data.Blueprints.NWN2GlobalBlueprintManager bpManager = new NWN2Toolset.NWN2.Data.Blueprints.NWN2GlobalBlueprintManager();
            //bpManager.Initialize();
            NWN2Toolset.NWN2.Data.TypedCollections.NWN2BlueprintCollection items = NWN2Toolset.NWN2.Data.Blueprints.NWN2GlobalBlueprintManager.GetBlueprintsOfType(NWN2Toolset.NWN2.Data.Templates.NWN2ObjectType.Item);
            ALFAItemBlueprint scroll;
            
            System.Windows.Forms.Form form = new System.Windows.Forms.Form();
            /*System.Windows.Forms.TextBox text = new System.Windows.Forms.TextBox();
            text.Size = new System.Drawing.Size(400, 300);
            text.Multiline = true;
            text.WordWrap = false;
            text.AcceptsReturn = true;
            text.AcceptsTab = true;
            text.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            text.Text = scroll.ToString();*/
            System.Windows.Forms.ListBox listBox = new System.Windows.Forms.ListBox();
            listBox.Sorted = true;
            listBox.HorizontalScrollbar = true;
            listBox.Size = new System.Drawing.Size(400, 300);

            form.Controls.Add(listBox);
            form.Size = new System.Drawing.Size(430, 330);
            form.Show();    

            //items.Add(scroll.ItemBlueprint);
            //scroll.TemplateResRef = "TEST RESREF";
            //scroll.AddItemProperty(ALFAItemProperty.CastSpell1ChargeItemProperty(0));
            //scroll.AddItemProperty(ALFAItemProperty.WizardOnlyItemProperty());            
            //items.Add(scroll.ItemBlueprint);

            ConsumableCreator cc = new ConsumableCreator();
            cc.Run();
        }
开发者ID:CastanoALFA,项目名称:ALFA-Base-Resources,代码行数:34,代码来源:ABR_Creator.cs


示例16: EditValue

        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var retval = Guid.Empty;
            try
            {
                edSvc = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));

                var indexColumn = context.Instance as IndexColumn;
                var field = indexColumn.Index.Entity.Fields.FirstOrDefault(x => x.Id == indexColumn.FieldID);
                var fieldList = indexColumn.Index.Entity.Fields.OrderBy(x => x.Name).ToList();

                //Create the list box
                var newBox = new System.Windows.Forms.ListBox();
                newBox.Click += new EventHandler(newBox_Click);
                newBox.IntegralHeight = false;

                newBox.Items.AddRange(fieldList.Select(x => x.Name).ToArray());
                if (field != null)
                    newBox.SelectedIndex = fieldList.IndexOf(field);

                edSvc.DropDownControl(newBox);
                if ((indexColumn != null) && (newBox.SelectedIndex != -1))
                    retval = fieldList[newBox.SelectedIndex].Id;

            }
            catch (Exception ex) { }
            return retval;
        }
开发者ID:jradxl,项目名称:nHydrate-Designer-Only,代码行数:28,代码来源:EntityFieldEditor.cs


示例17: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.listBoxLog = new System.Windows.Forms.ListBox();
     this.SuspendLayout();
     //
     // listBoxLog
     //
     this.listBoxLog.Dock = System.Windows.Forms.DockStyle.Fill;
     this.listBoxLog.FormattingEnabled = true;
     this.listBoxLog.ItemHeight = 16;
     this.listBoxLog.Location = new System.Drawing.Point(0, 0);
     this.listBoxLog.Name = "listBoxLog";
     this.listBoxLog.Size = new System.Drawing.Size(368, 257);
     this.listBoxLog.TabIndex = 0;
     //
     // FormLog
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(368, 257);
     this.Controls.Add(this.listBoxLog);
     this.Name = "FormLog";
     this.Text = "Результаты поиска";
     this.ResumeLayout(false);
 }
开发者ID:packpacka,项目名称:Lasers,代码行数:29,代码来源:FormLog.Designer+—+копия.cs


示例18: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.patientNameList = new System.Windows.Forms.ListBox();
     this.addButton = new System.Windows.Forms.Button();
     this.deleteButton = new System.Windows.Forms.Button();
     this.selectButton = new System.Windows.Forms.Button();
     this.SuspendLayout();
     //
     // patientNameList
     //
     this.patientNameList.FormattingEnabled = true;
     this.patientNameList.Location = new System.Drawing.Point(12, 12);
     this.patientNameList.Name = "patientNameList";
     this.patientNameList.Size = new System.Drawing.Size(211, 238);
     this.patientNameList.TabIndex = 0;
     //
     // addButton
     //
     this.addButton.Location = new System.Drawing.Point(285, 12);
     this.addButton.Name = "addButton";
     this.addButton.Size = new System.Drawing.Size(88, 23);
     this.addButton.TabIndex = 1;
     this.addButton.Text = "Add Patient";
     this.addButton.UseVisualStyleBackColor = true;
     this.addButton.Click += new System.EventHandler(this.addButton_Click);
     //
     // deleteButton
     //
     this.deleteButton.Location = new System.Drawing.Point(285, 41);
     this.deleteButton.Name = "deleteButton";
     this.deleteButton.Size = new System.Drawing.Size(88, 23);
     this.deleteButton.TabIndex = 2;
     this.deleteButton.Text = "Delete Patient";
     this.deleteButton.UseVisualStyleBackColor = true;
     this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click);
     //
     // selectButton
     //
     this.selectButton.Location = new System.Drawing.Point(285, 228);
     this.selectButton.Name = "selectButton";
     this.selectButton.Size = new System.Drawing.Size(88, 23);
     this.selectButton.TabIndex = 3;
     this.selectButton.Text = "Select Patient";
     this.selectButton.UseVisualStyleBackColor = true;
     this.selectButton.Click += new System.EventHandler(this.selectButton_Click);
     //
     // PatientDatabase
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(385, 262);
     this.Controls.Add(this.selectButton);
     this.Controls.Add(this.deleteButton);
     this.Controls.Add(this.addButton);
     this.Controls.Add(this.patientNameList);
     this.Name = "PatientDatabase";
     this.Text = "Patient Database";
     this.ResumeLayout(false);
 }
开发者ID:oh-team-machine,项目名称:Target-Tapping,代码行数:63,代码来源:PatientDatabase.designer.cs


示例19: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.butOK = new OpenDental.UI.Button();
     this.butCancel = new OpenDental.UI.Button();
     this.listUser = new System.Windows.Forms.ListBox();
     this.SuspendLayout();
     //
     // butOK
     //
     this.butOK.AdjustImageLocation = new System.Drawing.Point(0,0);
     this.butOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.butOK.Autosize = true;
     this.butOK.BtnShape = OpenDental.UI.enumType.BtnShape.Rectangle;
     this.butOK.BtnStyle = OpenDental.UI.enumType.XPStyle.Silver;
     this.butOK.CornerRadius = 4F;
     this.butOK.Location = new System.Drawing.Point(215,451);
     this.butOK.Name = "butOK";
     this.butOK.Size = new System.Drawing.Size(75,24);
     this.butOK.TabIndex = 3;
     this.butOK.Text = "&OK";
     this.butOK.Click += new System.EventHandler(this.butOK_Click);
     //
     // butCancel
     //
     this.butCancel.AdjustImageLocation = new System.Drawing.Point(0,0);
     this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.butCancel.Autosize = true;
     this.butCancel.BtnShape = OpenDental.UI.enumType.BtnShape.Rectangle;
     this.butCancel.BtnStyle = OpenDental.UI.enumType.XPStyle.Silver;
     this.butCancel.CornerRadius = 4F;
     this.butCancel.Location = new System.Drawing.Point(215,492);
     this.butCancel.Name = "butCancel";
     this.butCancel.Size = new System.Drawing.Size(75,24);
     this.butCancel.TabIndex = 2;
     this.butCancel.Text = "&Cancel";
     this.butCancel.Click += new System.EventHandler(this.butCancel_Click);
     //
     // listUser
     //
     this.listUser.FormattingEnabled = true;
     this.listUser.Location = new System.Drawing.Point(12,18);
     this.listUser.Name = "listUser";
     this.listUser.Size = new System.Drawing.Size(176,498);
     this.listUser.TabIndex = 4;
     this.listUser.DoubleClick += new System.EventHandler(this.listUser_DoubleClick);
     //
     // FormUserPick
     //
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
     this.ClientSize = new System.Drawing.Size(316,534);
     this.Controls.Add(this.listUser);
     this.Controls.Add(this.butOK);
     this.Controls.Add(this.butCancel);
     this.Name = "FormUserPick";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "Pick User";
     this.Load += new System.EventHandler(this.FormUserPick_Load);
     this.ResumeLayout(false);
 }
开发者ID:nampn,项目名称:ODental,代码行数:63,代码来源:FormUserPick.designer.cs


示例20: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.splitContainer1 = new System.Windows.Forms.SplitContainer();
       this.listBox1 = new System.Windows.Forms.ListBox();
       this.tv = new System.Windows.Forms.TreeView();
       this.splitContainer1.Panel1.SuspendLayout();
       this.splitContainer1.Panel2.SuspendLayout();
       this.splitContainer1.SuspendLayout();
       this.SuspendLayout();
       //
       // splitContainer1
       //
       this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
       this.splitContainer1.Location = new System.Drawing.Point( 0, 0 );
       this.splitContainer1.Name = "splitContainer1";
       //
       // splitContainer1.Panel1
       //
       this.splitContainer1.Panel1.Controls.Add( this.listBox1 );
       //
       // splitContainer1.Panel2
       //
       this.splitContainer1.Panel2.Controls.Add( this.tv );
       this.splitContainer1.Size = new System.Drawing.Size( 459, 556 );
       this.splitContainer1.SplitterDistance = 153;
       this.splitContainer1.TabIndex = 0;
       //
       // listBox1
       //
       this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
       this.listBox1.FormattingEnabled = true;
       this.listBox1.Location = new System.Drawing.Point( 0, 0 );
       this.listBox1.Name = "listBox1";
       this.listBox1.Size = new System.Drawing.Size( 153, 550 );
       this.listBox1.Sorted = true;
       this.listBox1.TabIndex = 0;
       this.listBox1.SelectedIndexChanged += new System.EventHandler( this.listBox1_SelectedIndexChanged );
       //
       // tv
       //
       this.tv.Dock = System.Windows.Forms.DockStyle.Fill;
       this.tv.Location = new System.Drawing.Point( 0, 0 );
       this.tv.Name = "tv";
       this.tv.Size = new System.Drawing.Size( 302, 556 );
       this.tv.TabIndex = 0;
       //
       // CmdInspectElectricalForm2
       //
       this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F );
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       this.ClientSize = new System.Drawing.Size( 459, 556 );
       this.Controls.Add( this.splitContainer1 );
       this.Name = "CmdInspectElectricalForm2";
       this.Text = "Electrical System Inspector";
       this.splitContainer1.Panel1.ResumeLayout( false );
       this.splitContainer1.Panel2.ResumeLayout( false );
       this.splitContainer1.ResumeLayout( false );
       this.ResumeLayout( false );
 }
开发者ID:jeremytammik,项目名称:AdnRme,代码行数:63,代码来源:CmdInspectElectricallForm2.designer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.ListView类代码示例发布时间:2022-05-24
下一篇:
C# Forms.LinkLabel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap