當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.ToolStripTextBox類代碼示例

本文整理匯總了C#中System.Windows.Forms.ToolStripTextBox的典型用法代碼示例。如果您正苦於以下問題:C# ToolStripTextBox類的具體用法?C# ToolStripTextBox怎麽用?C# ToolStripTextBox使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ToolStripTextBox類屬於System.Windows.Forms命名空間,在下文中一共展示了ToolStripTextBox類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Constructor

		public void Constructor ()
		{
			ToolStripTextBox tsi = new ToolStripTextBox ();

			Assert.AreEqual (false, tsi.AcceptsReturn, "A1");
			Assert.AreEqual (false, tsi.AcceptsTab, "A2");
			Assert.AreEqual ("System.Windows.Forms.AutoCompleteStringCollection", tsi.AutoCompleteCustomSource.GetType ().ToString (), "A3");
			Assert.AreEqual (AutoCompleteMode.None, tsi.AutoCompleteMode, "A4");
			Assert.AreEqual (AutoCompleteSource.None, tsi.AutoCompleteSource, "A5");
			Assert.AreEqual (BorderStyle.Fixed3D, tsi.BorderStyle, "A6");
			Assert.AreEqual (false, tsi.CanUndo, "A7");
			Assert.AreEqual (CharacterCasing.Normal, tsi.CharacterCasing, "A8");
			Assert.AreEqual (true, tsi.HideSelection, "A9");
			Assert.AreEqual ("System.String[]", tsi.Lines.GetType ().ToString (), "A10");
			Assert.AreEqual (32767, tsi.MaxLength, "A11");
			//Bug in TextBox
			//Assert.AreEqual (false, tsi.Modified, "A12");
			Assert.AreEqual (false, tsi.ReadOnly, "A13");
			Assert.AreEqual (string.Empty, tsi.SelectedText, "A14");
			Assert.AreEqual (0, tsi.SelectionLength, "A15");
			Assert.AreEqual (0, tsi.SelectionStart, "A16");
			Assert.AreEqual (true, tsi.ShortcutsEnabled, "A17");
			Assert.AreEqual ("System.Windows.Forms.ToolStripTextBox+ToolStripTextBoxControl", tsi.TextBox.GetType ().ToString (), "A18");
			Assert.AreEqual (HorizontalAlignment.Left, tsi.TextBoxTextAlign, "A19");
			Assert.AreEqual (0, tsi.TextLength, "A20");

			tsi = new ToolStripTextBox ("Bob");
			Assert.AreEqual ("Bob", tsi.Name, "A21");
			Assert.AreEqual (string.Empty, tsi.Control.Name, "A22");
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:30,代碼來源:ToolStripTextBoxTest.cs

示例2: BrowseData

 public BrowseData(ToolStripTextBox textBox, Button buttonOk, CtrlType ctrlType)
 {
     _textBox = textBox;
     _buttonOk = buttonOk;
     _ctrlType = ctrlType;
     buttonOk.Enabled = false;
 }
開發者ID:jsakamoto,項目名稱:bjd5,代碼行數:7,代碼來源:BrowseData.cs

示例3: Bind

        public static void Bind(ToolStripMenuItem parent, string path)
        {
            foreach (ExtensionNode node in AddinManager.GetExtensionObjects("/EcIDE/Menu/" + path))
            {
                var cmds = node.GetCommand();

                foreach (var ec in cmds)
                {
                    var eps = ec as separator;
                    if (eps != null)
                    {
                        parent.DropDownItems.Add(new ToolStripSeparator());
                    }

                    var ep = ec as menuitem;
                    if (ep != null)
                    {
                        var target = node.CreateInstances<IMenu>()[0];

                        target.Init(new ServiceContainer());

                        var it = new ToolStripMenuItem(
                            ep.text,
                            null,
                            (sender, args) =>
                                target.GetType().GetMethod(ep.click).Invoke(target, new[] { sender, args }));

                        try
                        {
                            it.Enabled = bool.Parse(ep.enabled);
                        }
                        catch { }

                        parent.DropDownItems.Add(it);
                    }

                    var eptb = ec as textbox;
                    if (eptb != null)
                    {
                        var target = node.CreateInstances<IMenu>()[0];

                        target.Init(new ServiceContainer());

                        var tb = new ToolStripTextBox();
                        tb.TextChanged += (sender, args) => target.GetType().GetMethod(eptb.textchanged).Invoke(target, new[] { sender, args });

                        try
                        {
                            tb.Visible = bool.Parse(eptb.visible);
                        }
                        catch
                        {
                        }

                        parent.DropDownItems.Add(tb);
                    }
                }
            }
        }
開發者ID:Myvar,項目名稱:Eclang,代碼行數:59,代碼來源:MenuBinder.cs

示例4: ParallaxToolStrip

        public ParallaxToolStrip(SerialParallax osc, GraphControl gc)
        {
            oscillo = osc;
            graphControl = gc;

            //
            // toolStrip2
            //
            this.toolStrip = new System.Windows.Forms.ToolStrip();
            this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;
            this.toolStrip.Location = new System.Drawing.Point(3, 0);
            this.toolStrip.Name = "toolStrip2";
            this.toolStrip.Size = new System.Drawing.Size(243, 25);
            this.toolStrip.TabIndex = 1;
            this.toolStrip.Text = "toolStrip2";

            this.triggerLabel = new System.Windows.Forms.ToolStripLabel();
            this.trigger = new System.Windows.Forms.ToolStripTextBox();
            this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
            this.triggerMode = new System.Windows.Forms.ToolStripComboBox();

            //
            // triggerLabel
            //
            this.triggerLabel.Name = "triggerLabel";
            this.triggerLabel.Size = new System.Drawing.Size(42, 22);
            this.triggerLabel.Text = "trigger";
            this.toolStrip.Items.Add(this.triggerLabel);

            //
            // trigger
            //
            this.trigger.Name = "trigger";
            this.trigger.Size = new System.Drawing.Size(50, 25);
            this.trigger.Text = "0";
            this.trigger.Validating += new System.ComponentModel.CancelEventHandler(this.trigger_Validating);
            this.trigger.Validated += new System.EventHandler(this.trigger_Validated);
            this.toolStrip.Items.Add(this.trigger);

            //
            // triggerMode
            //
            this.triggerMode.Items.AddRange(new object[] {
            "ch1 ˄",
            "ch1 ˅",
            "ch2 ˄",
            "ch2 ˅",
            "ext ˄"});
            this.triggerMode.Name = "triggerMode";
            this.triggerMode.Size = new System.Drawing.Size(20, 25);
            this.triggerMode.SelectedIndexChanged += new System.EventHandler(this.triggerMode_SelectedIndexChanged);
            triggerMode.SelectedIndex = 0;
            this.toolStrip.Items.Add(this.triggerMode);

            //channels.SelectedIndex = 0;
            trigger.Text = "0";
            triggerMode.SelectedIndex = 0;
            oscillo.TriggerVoltage = (float.Parse(trigger.Text));
        }
開發者ID:karawin,項目名稱:xoscillo,代碼行數:59,代碼來源:ParallaxToolStrip.cs

示例5: InitToolBar

 //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡι��߳�ʼ����
 protected void InitToolBar(ShoulderToolBar obBar, ToolStripTextBox obText, ToolStripButton obButton, string text)
 {
     obBar.Parent = this;
     obText.Text = text;
     obBar.Dock = DockStyle.Top;
     obBar.AddItem(obText, true);
     obBar.Items.Add(obButton);
 }
開發者ID:r1ng0to3tour,項目名稱:swsplayer,代碼行數:9,代碼來源:AppForm.cs

示例6: AddSearch

 private void AddSearch()
 {
     this.toolStrip1.Items.Add("ѧԱ����");
     ToolStripTextBox txt = new System.Windows.Forms.ToolStripTextBox();
     txt.KeyDown += new KeyEventHandler(txt_KeyDown);
     txt.ToolTipText = "�����������س���ѯ";
     this.toolStrip1.Items.Add(txt);
 }
開發者ID:romanu6891,項目名稱:fivemen,代碼行數:8,代碼來源:StudentFeeSearch.cs

示例7: TagMenu

		public TagMenu() {
			base.Text = Resources.TagsMenuHeader;

			customTag = new ToolStripTextBox();
			customTag.KeyUp += CustomTagKeyUp;

			DropDownOpening += OnDropDownOpening;
		}
開發者ID:dbremner,項目名稱:szotar,代碼行數:8,代碼來源:TagMenu.cs

示例8: AddSearch

 private void AddSearch()
 {
     this.toolStrip1.Items.Add("姓名");
     txt = new System.Windows.Forms.ToolStripTextBox();
     txt.KeyDown += new KeyEventHandler(txt_KeyDown);
     txt.ToolTipText = "輸入姓名按回車查詢";
     this.toolStrip1.Items.Add(txt);
 }
開發者ID:romanu6891,項目名稱:fivemen,代碼行數:8,代碼來源:UploadFingerRecordSearch.cs

示例9: initTool

 //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡι��߳�ʼ����
 public void initTool(ShoulderToolBar obTool, ToolStripTextBox obText, ToolStripButton obButton, string stPath)
 {
     obTool.Parent = m_obParent;
     obTool.Dock = DockStyle.Top;
     obTool.AddItem(obText, true);
     obTool.Items.Add(obButton);
     obText.Text = stPath;
 }
開發者ID:r1ng0to3tour,項目名稱:swsplayer,代碼行數:9,代碼來源:LineLayout.cs

示例10: LoadMenu

		public void LoadMenu(ToolStripMenuItem item) {
			// Add option to change chart size
			var container = new ToolStripMenuItem("Chart size");
			item.DropDownItems.Add(container);
			var txtChartSize = new ToolStripTextBox("txtChartSize");
			txtChartSize.Text = "Chart size";
			txtChartSize.TextBox.Text = mChartSize.ToString();
			txtChartSize.TextChanged += new EventHandler(txtChartSize_TextChanged);
			container.DropDownItems.Add(txtChartSize);
		}
開發者ID:GodLesZ,項目名稱:svn-dump,代碼行數:10,代碼來源:PalPreviewPanel.cs

示例11: InitializeComponent

 private void InitializeComponent()
 {
     ComponentResourceManager manager = new ComponentResourceManager(typeof(PropertyVersionFilterControl));
     this.tsTop = new ToolStrip();
     this.tslField = new ToolStripLabel();
     this.tslPropertyName = new ToolStripLabel();
     this.tslIs = new ToolStripLabel();
     this.tsddValueOperation = new ToolStripDropDownButton();
     this.tsmiOperationEquals = new ToolStripMenuItem();
     this.tsmiOperationNotEquals = new ToolStripMenuItem();
     this.tsmiOperationSmaller = new ToolStripMenuItem();
     this.tsmiOperationLarger = new ToolStripMenuItem();
     this.tstbValue = new ToolStripTextBox();
     this.tsTop.SuspendLayout();
     base.SuspendLayout();
     this.tsTop.BackColor = Color.Transparent;
     manager.ApplyResources(this.tsTop, "tsTop");
     this.tsTop.GripStyle = ToolStripGripStyle.Hidden;
     this.tsTop.Items.AddRange(new ToolStripItem[] { this.tslField, this.tslPropertyName, this.tslIs, this.tsddValueOperation, this.tstbValue });
     this.tsTop.Name = "tsTop";
     this.tslField.Name = "tslField";
     manager.ApplyResources(this.tslField, "tslField");
     this.tslPropertyName.Name = "tslPropertyName";
     manager.ApplyResources(this.tslPropertyName, "tslPropertyName");
     this.tslIs.Name = "tslIs";
     manager.ApplyResources(this.tslIs, "tslIs");
     this.tsddValueOperation.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.tsddValueOperation.DropDownItems.AddRange(new ToolStripItem[] { this.tsmiOperationEquals, this.tsmiOperationNotEquals, this.tsmiOperationSmaller, this.tsmiOperationLarger });
     this.tsddValueOperation.Name = "tsddValueOperation";
     manager.ApplyResources(this.tsddValueOperation, "tsddValueOperation");
     this.tsmiOperationEquals.Name = "tsmiOperationEquals";
     manager.ApplyResources(this.tsmiOperationEquals, "tsmiOperationEquals");
     this.tsmiOperationEquals.Click += new EventHandler(this.tsmiOperationEquals_Click);
     this.tsmiOperationNotEquals.Name = "tsmiOperationNotEquals";
     manager.ApplyResources(this.tsmiOperationNotEquals, "tsmiOperationNotEquals");
     this.tsmiOperationNotEquals.Click += new EventHandler(this.tsmiOperationEquals_Click);
     this.tsmiOperationSmaller.Name = "tsmiOperationSmaller";
     manager.ApplyResources(this.tsmiOperationSmaller, "tsmiOperationSmaller");
     this.tsmiOperationSmaller.Click += new EventHandler(this.tsmiOperationEquals_Click);
     this.tsmiOperationLarger.Name = "tsmiOperationLarger";
     manager.ApplyResources(this.tsmiOperationLarger, "tsmiOperationLarger");
     this.tsmiOperationLarger.Click += new EventHandler(this.tsmiOperationEquals_Click);
     this.tstbValue.BorderStyle = BorderStyle.FixedSingle;
     manager.ApplyResources(this.tstbValue, "tstbValue");
     this.tstbValue.Name = "tstbValue";
     this.tstbValue.TextChanged += new EventHandler(this.tstbValue_TextChanged);
     manager.ApplyResources(this, "$this");
     base.AutoScaleMode = AutoScaleMode.Font;
     base.Controls.Add(this.tsTop);
     base.Name = "PropertyVersionFilterControl";
     this.tsTop.ResumeLayout(false);
     this.tsTop.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
開發者ID:shankithegreat,項目名稱:commanderdotnet,代碼行數:55,代碼來源:PropertyVersionFilterControl.cs

示例12: GetContextMenuItems

        public ToolStripItem[] GetContextMenuItems(Lib.Control Control)
        {
            var getCommandMenuItem = new ToolStripMenuItem("Get Command");
            var getCommandTextBox = new ToolStripTextBox("Get Command Text Box");

            getCommandMenuItem.DropDownItems.Add(getCommandTextBox);
            getCommandTextBox.TextChanged += new EventHandler(GetCommandToolStripTextBox_TextChanged);
            getCommandTextBox.Tag = Control;

            return new ToolStripItem[] { getCommandMenuItem };
        }
開發者ID:ngpitt,項目名稱:OpenLab,代碼行數:11,代碼來源:Meter.cs

示例13: BuildOwnToolStripMenu

        private void BuildOwnToolStripMenu()
        {
            ToolStripLabel tslSearch = new ToolStripLabel("Suche:");
            this.toolStripMain.Items.Add(tslSearch);

            ToolStripTextBox tstbSearch = new ToolStripTextBox("tstbSearch");
            tstbSearch.Text = "Suchbegriff";
            tstbSearch.ForeColor = Color.Gray;
            tstbSearch.KeyDown += new KeyEventHandler(tstbSearch_KeyDown);
            tstbSearch.GotFocus += new EventHandler(tstbSearch_GotFocus);
            tstbSearch.LostFocus += new EventHandler(tstbSearch_LostFocus);

            this.toolStripMain.Items.Add(tstbSearch);
        }
開發者ID:fdeitelhoff,項目名稱:Twainsoft.ImageProcessing,代碼行數:14,代碼來源:FrmToolboxShapes.cs

示例14: AddSearch

        private void AddSearch()
        {
            this.toolStrip1.Items.Add("����");
            txt1 = new System.Windows.Forms.ToolStripTextBox();

            txt1.KeyDown += new KeyEventHandler(txt1_KeyDown);
            txt1.ToolTipText = "���복�ΰ��س���ѯ";
            this.toolStrip1.Items.Add(txt1);

            this.toolStrip1.Items.Add("վ��");
            txt2 = new System.Windows.Forms.ToolStripTextBox();

            txt2.KeyDown += new KeyEventHandler(txt2_KeyDown);
            txt2.ToolTipText = "����վ�����س���ѯ";
            this.toolStrip1.Items.Add(txt2);
        }
開發者ID:romanu6891,項目名稱:fivemen,代碼行數:16,代碼來源:TrainSearchControl.cs

示例15: addTextBox

 public static ToolStripItem addTextBox(object control, String controlName, string defaultValue, KeyEventHandler onKeyUp)
 {
     var toolStrip = getToolStripControl(control);
     if (toolStrip != null)
     {
         return (ToolStripItem)toolStrip.invokeOnThread(
             () =>
             {
                 var newTextBox = new ToolStripTextBox(controlName) { Text = defaultValue };
                 toolStrip.Items.Add(newTextBox);
                 if (onKeyUp != null)
                     newTextBox.KeyUp += onKeyUp;
                 return newTextBox;
             });
     }
     return null;
 }   
開發者ID:pusp,項目名稱:o2platform,代碼行數:17,代碼來源:O2Forms_ThreadSafe_ToolStrip.cs


注:本文中的System.Windows.Forms.ToolStripTextBox類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。