本文整理汇总了C#中System.Windows.Forms.ToolStripComboBox类的典型用法代码示例。如果您正苦于以下问题:C# ToolStripComboBox类的具体用法?C# ToolStripComboBox怎么用?C# ToolStripComboBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolStripComboBox类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripComboBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyTheme
static void ApplyTheme(ToolStripComboBox c)
{
c.Font = new Font("Candara", 9.0f);
c.BackColor = Color.Lavender;
c.ForeColor = Color.DarkMagenta;
c.FlatStyle = FlatStyle.System;
}
示例2: loadIntoToolStripCombox_O2FindingFieldsNames
public static void loadIntoToolStripCombox_O2FindingFieldsNames(ToolStripComboBox comboBox, string defaultValue)
{
comboBox.Items.Clear();
foreach (PropertyInfo property in typeof (O2Finding).GetProperties())
comboBox.Items.Add(property.Name);
comboBox.Text = defaultValue;
}
示例3: Constructor
public void Constructor ()
{
ToolStripComboBox tsi = new ToolStripComboBox ();
//Assert.AreEqual ("System.Windows.Forms.AutoCompleteStringCollection", tsi.AutoCompleteCustomSource.GetType ().ToString (), "A1");
//Assert.AreEqual (AutoCompleteMode.None, tsi.AutoCompleteMode, "A2");
//Assert.AreEqual (AutoCompleteSource.None, tsi.AutoCompleteSource, "A3");
Assert.AreEqual ("System.Windows.Forms.ToolStripComboBox+ToolStripComboBoxControl", tsi.ComboBox.GetType ().ToString (), "A4");
//Assert.AreEqual (106, tsi.DropDownHeight, "A5");
Assert.AreEqual (ComboBoxStyle.DropDown, tsi.DropDownStyle, "A6");
Assert.AreEqual (121, tsi.DropDownWidth, "A7");
Assert.AreEqual (false, tsi.DroppedDown, "A8");
Assert.AreEqual (FlatStyle.Popup, tsi.FlatStyle, "A9");
Assert.AreEqual (true, tsi.IntegralHeight, "A10");
Assert.AreEqual ("System.Windows.Forms.ComboBox+ObjectCollection", tsi.Items.ToString (), "A11");
Assert.AreEqual (8, tsi.MaxDropDownItems, "A12");
Assert.AreEqual (0, tsi.MaxLength, "A13");
Assert.AreEqual (-1, tsi.SelectedIndex, "A14");
Assert.AreEqual (null, tsi.SelectedItem, "A15");
Assert.AreEqual (string.Empty, tsi.SelectedText, "A16");
Assert.AreEqual (0, tsi.SelectionLength, "A17");
Assert.AreEqual (0, tsi.SelectionStart, "A18");
Assert.AreEqual (false, tsi.Sorted, "A19");
tsi = new ToolStripComboBox ("Bob");
Assert.AreEqual ("Bob", tsi.Name, "A20");
Assert.AreEqual (string.Empty, tsi.Control.Name, "A21");
}
示例4: MenuInitialization
/// <summary>
/// Создание меню главного окна программы
/// </summary>
private void MenuInitialization()
{
this.menu = new MenuStrip();
this.MainMenuStrip = menu;
this.Controls.Add(this.menu);
this.menu.BackColor = Color.DimGray;
this.menu.ForeColor = Color.LightSkyBlue;
this.menu.Dock = DockStyle.Top;
this.menuItemFile = (ToolStripMenuItem)this.menu.Items.Add("&File");
this.menuItemEdit = (ToolStripMenuItem)this.menu.Items.Add("&Edit");
this.menuItemComboBox = new ToolStripComboBox();
this.menuItemComboBox.Items.Add("connect");
this.menuItemComboBox.Items.Add("disconnect");
this.menuItemComboBox.SelectedItem = "connect";
this.menu.Items.Add(this.menuItemComboBox);
this.menuItemSearch = new ToolStripTextBox();
this.menuItemSearch.Text = "Поиск";
this.menuItemSearch.ForeColor = Color.DimGray;
this.menu.Items.Add(this.menuItemSearch);
this.fileItemOpen = this.menuItemFile.DropDownItems.Add("Open");
this.fileItemSave = this.menuItemFile.DropDownItems.Add("Save");
this.fileItemClose = this.menuItemFile.DropDownItems.Add("Close");
this.editItemUndo = this.menuItemEdit.DropDownItems.Add("Undo");
this.editItemRedo = this.menuItemEdit.DropDownItems.Add("Redo");
this.menuItemEdit.DropDownItems.Add(new ToolStripSeparator());
this.editItemCopy = this.menuItemEdit.DropDownItems.Add("Copy");
this.editItemPast = this.menuItemEdit.DropDownItems.Add("Past");
this.menu.Show();
}
示例5: ApplyTheme
static void ApplyTheme(ToolStripComboBox c)
{
c.Font = new Font("Times New Roman", 9.0f);
c.BackColor = Color.White;
c.ForeColor = Color.Black;
c.FlatStyle = FlatStyle.System;
}
示例6: KeySearch
/* поиск по ключу */
public void KeySearch(String _sqlQuery, ToolStripComboBox _cbox)
{
bool resolution = true;
try{
for(int k = 0; k < _cbox.Items.Count; k++)
if(_cbox.Items[k].ToString() == _cbox.Text) resolution = false;
if(resolution) _cbox.Items.Add(_cbox.Text);
_localDataSet.Clear(); // очистка
_localClient.SelectSqlCommand = _sqlQuery;
_localClient.ExecuteFill(_localDataSet, "Хранилище");
// Загрузка дерева даных
String NameGr = "";
treeView1.Nodes.Clear();
for(int i = 0; i < _localDataSet.Tables["Хранилище"].Rows.Count; i++){
if(_localDataSet.Tables["Хранилище"].Rows[i]["ТипОбъекта"].ToString() == "Элемент"){
NameGr = _localDataSet.Tables["Хранилище"].Rows[i]["ФайлИдентификатор"].ToString();
treeView1.Nodes.Add(NameGr);
treeView1.Nodes[treeView1.Nodes.Count-1].ImageIndex = 2;
treeView1.Nodes[treeView1.Nodes.Count-1].SelectedImageIndex = 2;
}
}
treeView1.Select();
if(treeView1.Nodes.Count <= 0) treeviewMenu("");
}catch{
treeView1.Nodes.Clear();
_localDataSet.Clear();
richTextBox1.Clear();
}
}
示例7: CreateComboBox
protected ToolStripComboBox CreateComboBox(ChoiceGroup choice, bool wantsSeparatorBefore)
{
UIItemDisplayProperties display = choice.GetDisplayProperties();
string label = display.Text;
choice.PopulateNow();
if (label == null)
label = AdapterStrings.ErrorGeneratingLabel;
if (!display.Visible)
return null;
label = label.Replace("_", "&");
ToolStripComboBox combo = new ToolStripComboBox();
combo.Text = label;
//foreach(ChoiceBase s in choice)
//{
// item.Items.Add(s.Label);
//}
//item.Tag = choice;
choice.ReferenceWidget = combo;
combo.Tag = choice;
FillCombo(choice);
combo.SelectedIndexChanged += new EventHandler(OnSelectedIndexChanged);
combo.Enabled = display.Enabled;
combo.Visible = display.Visible;
return combo;
}
示例8: DefaultPickFilter
void IInitializable.Initialize()
{
if (m_pickFilters == null)
{
m_designView.PickFilter = new DefaultPickFilter();
return;
}
m_pickFilterComboBox = new ToolStripComboBox();
m_pickFilterComboBox.BeginUpdate();
m_pickFilterComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
m_pickFilterComboBox.Name = "pickCombo";
m_pickFilterComboBox.ToolTipText = "Picking Filter".Localize();
var defFilter = new DefaultPickFilter();
m_filters.Add(defFilter.Name, defFilter);
m_pickFilterComboBox.Items.Add(defFilter.Name);
foreach (IPickFilter pickFilter in m_pickFilters)
{
m_filters.Add(pickFilter.Name, pickFilter);
m_pickFilterComboBox.Items.Add(pickFilter.Name);
}
m_designView.PickFilter = defFilter;
m_pickFilterComboBox.SelectedIndex = 0;
m_pickFilterComboBox.EndUpdate();
MenuInfo.Edit.GetToolStrip().Items.Add(m_pickFilterComboBox);
m_pickFilterComboBox.SelectedIndexChanged += PickpickFilterComboBox_SelectedIndexChanged;
m_settingsService.RegisterSettings(this,new BoundPropertyDescriptor(this, () => ActivePickFilter, "ActiveFilter",null, null));
}
示例9: LangComboxAdaptor
public LangComboxAdaptor(ToolStripComboBox combox,Form frm)
{
this.combox = combox;
this.frm = frm;
combox.Items.Clear();
string lang = StringResources.GetValue("lang");
if (lang == null)
{
lang = "EN";
}
ArrayList tmpList = (ArrayList)Language.GetLanguageList(lang);
foreach (string tmpStr in tmpList)
{
int idex= combox.Items.Add(tmpStr);
if (getLangFromString(tmpStr) == lang)
{
combox.SelectedIndex = idex;
}
}
/* Reg Event */
combox.SelectedIndexChanged += combox_SelectedIndexChanged;
}
示例10: ZoomAdaptor
public ZoomAdaptor(PicView picView,
ToolStripButton plusBtn,
ToolStripButton minusBtn,
ToolStripComboBox combox)
{
this.picView = picView;
//this.form = form;
this.plusBtn = plusBtn;
this.minusBtn = minusBtn;
this.combox = combox;
picView.ZoomChanged += new EventHandler(zoomChanged);
plusBtn.Click += new EventHandler(btnClick);
minusBtn.Click += new EventHandler(btnClick);
combox.DropDownStyle = ComboBoxStyle.DropDown;
combox.DropDownHeight = 200;
for(int i=20; i<=100; i+=20){
combox.Items.Add(i.ToString() + "%");
}
combox.SelectedIndexChanged += new EventHandler(comboxTextUpdate);
combox.Leave += new EventHandler(comboxTextUpdate);
combox.KeyDown += new KeyEventHandler(comboxKeyDown);
renew();
}
示例11: ApplyTheme
static void ApplyTheme(ToolStripComboBox c)
{
c.ComboBox.Font = new Font("Franklin Gothic", 9.0f);
c.ComboBox.BackColor = Color.Black;
c.ComboBox.ForeColor = Color.LightGray;
c.FlatStyle = FlatStyle.Popup;
}
示例12: loadIntoToolStripCombox_O2TraceTypes
public static void loadIntoToolStripCombox_O2TraceTypes(ToolStripComboBox comboBox)
{
comboBox.Items.Clear();
foreach (object value in Enum.GetValues(typeof (TraceType)))
comboBox.Items.Add(value);
}
示例13: 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));
}
示例14: getToolStripComboValues
protected string getToolStripComboValues(ToolStripComboBox tcmb)
{
string[] items = new String[tcmb.Items.Count];
for (int i = 0; i < tcmb.Items.Count; i++) {
items[i] = (string)tcmb.Items[i];
}
return CommonLang.ArrayHelper<string>.join(items, ";");
}
示例15: ReloadQueries
/// <summary>
/// Reloads all xml queries
/// </summary>
/// <param name="cbx">combobox to fill</param>
/// <param name="extension">file extention</param>
public static void ReloadQueries(ToolStripComboBox cbx, string extension = "*.xml")
{
cbx.Items.Clear();
foreach (var file in new DirectoryInfo(DirectoryPath).GetFiles(extension))
{
cbx.Items.Add(file.Name.Replace(extension, ""));
}
}