本文整理汇总了C#中System.Windows.Forms.ToolStripLabel类的典型用法代码示例。如果您正苦于以下问题:C# ToolStripLabel类的具体用法?C# ToolStripLabel怎么用?C# ToolStripLabel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolStripLabel类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripLabel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VerifyPatterns
private void VerifyPatterns (ToolStripLabel menuItem, bool expectInvokeSupport)
{
IRawElementProviderSimple provider = ProviderFactory.GetProvider (menuItem);
// Should never support Text
object textProvider = provider.GetPatternProvider (TextPatternIdentifiers.Pattern.Id);
Assert.IsNull (textProvider);
// Should never support TableItem
object tableItemProvider = provider.GetPatternProvider (TableItemPatternIdentifiers.Pattern.Id);
Assert.IsNull (tableItemProvider);
// Should never support RangeValue
object rangeValueProvider = provider.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id);
Assert.IsNull (rangeValueProvider);
// Should never support Value
object valueProvider = provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id);
Assert.IsNull (valueProvider);
// Support Invoke conditionally
object invokeProvider = provider.GetPatternProvider (InvokePatternIdentifiers.Pattern.Id);
if (expectInvokeSupport) {
Assert.IsNotNull (invokeProvider);
Assert.IsTrue (invokeProvider is IInvokeProvider, "IInvokeProvider");
} else
Assert.IsNull (invokeProvider);
}
示例2: TaskBarIconMenu
public TaskBarIconMenu()
{
TrayIcon_Menu = new ContextMenuStrip();
TrayIcon_Artist = new ToolStripLabel();
TrayIcon_Title = new ToolStripLabel();
TrayIcon_Diff = new ToolStripLabel();
TrayIcon_Play = new ToolStripMenuItem();
TrayIcon_PlayNext = new ToolStripMenuItem();
TrayIcon_PlayPrev = new ToolStripMenuItem();
TrayIcon_Exit = new ToolStripMenuItem();
TrayIcon_Menu.SuspendLayout();
TrayIcon_Menu.Items.AddRange(new ToolStripItem[] {
TrayIcon_Artist,
TrayIcon_Title,
TrayIcon_Diff,
TrayIcon_Play,
TrayIcon_PlayNext,
TrayIcon_PlayPrev,
TrayIcon_Exit});
TrayIcon_Menu.Name = "TrayIcon_Menu";
TrayIcon_Menu.Size = new Size(176, 176);
// TrayIcon_Artist
TrayIcon_Artist.Name = "TrayIcon_Artist";
TrayIcon_Artist.Text = LanguageManager.Get("TrayIcon_Aritst_Text");
TrayIcon_Artist.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Bold, GraphicsUnit.Point, 134);
// TrayIcon_Title
TrayIcon_Title.Name = "TrayIcon_Title";
TrayIcon_Title.Text = LanguageManager.Get("TrayIcon_Title_Text");
TrayIcon_Title.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Bold, GraphicsUnit.Point, 134);
// TrayIcon_Diff
TrayIcon_Diff.Name = "TrayIcon_Diff";
TrayIcon_Diff.Text = LanguageManager.Get("TrayIcon_Diff_Text");
TrayIcon_Diff.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Bold, GraphicsUnit.Point, 134);
// TrayIcon_Play
TrayIcon_Play.Name = "TrayIcon_Play";
TrayIcon_Play.Text = LanguageManager.Get("TrayIcon_Play_Pause_Text");
TrayIcon_Play.Click += delegate { SendKeys.Send("%{F5}"); };
// TrayIcon_PlayNext
TrayIcon_PlayNext.Name = "TrayIcon_PlayNext";
TrayIcon_PlayNext.Text = LanguageManager.Get("TrayIcon_PlayNext_Text");
TrayIcon_PlayNext.Click += delegate { SendKeys.Send("%{RIGHT}"); };
// TrayIcon_PlayNext
TrayIcon_PlayPrev.Name = "TrayIcon_PlayPrev";
TrayIcon_PlayPrev.Text = LanguageManager.Get("TrayIcon_PlayPrev_Text");
TrayIcon_PlayPrev.Click += delegate { SendKeys.Send("%{LEFT}"); };
// TrayIcon_Exit
TrayIcon_Exit.Name = "TrayIcon_Exit";
TrayIcon_Exit.Text = LanguageManager.Get("TrayIcon_Exit_Text");
TrayIcon_Exit.Click += delegate
{
if (
MessageBox.Show(LanguageManager.Get("Comfirm_Exit_Text"), LanguageManager.Get("Tip_Text"),
MessageBoxButtons.YesNo) != DialogResult.Yes) return;
Core.MainIsVisible = false;
Core.Exit();
Environment.Exit(0);
};
TrayIcon_Menu.ResumeLayout(false);
}
示例3: usbDevice
public usbDevice(string letter,List<Drive> drives,string serial)
{
InitializeComponent();
this.serial = serial;
this.drives = drives;
this.letter = letter;
syncdetails = new List<string[]>();
// this.usbserial = usbserial;
this.Load += (s, a) =>
{
this.ContextMenuStrip = contextMenuStrip1;
frm = this.FindForm();
lb = (ListView) frm.Controls.Find("listView1", true)[0];
ts = (ToolStrip)frm.Controls.Find("toolStrip1", true)[0];
lblSyncType = (ToolStripLabel)ts.Items.Find("lblSyncType", true)[0];
panel1=(Panel)frm.Controls.Find("panel1",true)[0];
label3 = (Label)frm.Controls.Find("label3", true)[0];
label2 = (Label)frm.Controls.Find("label2", true)[0];
// regBtn = (Button)frm.Controls.Find("btnRegister", true)[0];
treeview = (TreeView)frm.Controls.Find("treeView1", true)[0];
string lt = letter.Substring(0, 1);
serial = DriveInformation.getSerial(lt + ":\\"); //USB.FindDriveLetter(lt + ":").SerialNumber;
//Thread secondaryThread=new Thread(new ThreadStart(getDeviceData));
//secondaryThread.Start();
LoadDevice();
};
}
示例4: TextEditor
public TextEditor()
{
InitializeComponent();
Settings.SetupWindowPosition(SavedWindows.Main, this);
// highlighting
FileSyntaxModeProvider fsmProvider = new FileSyntaxModeProvider(Settings.ResourcesFolder); // Create new provider with the highlighting directory.
HighlightingManager.Manager.AddSyntaxModeFileProvider(fsmProvider); // Attach to the text editor.
// folding timer
timer = new Timer();
timer.Interval = 1000;
timer.Tick += new EventHandler(timer_Tick);
// Recent files
UpdateRecentList();
// Templates
foreach (string file in Directory.GetFiles(Path.Combine(Settings.ResourcesFolder, "templates"), "*.ssl")) {
ToolStripMenuItem mi = new ToolStripMenuItem(Path.GetFileNameWithoutExtension(file), null, delegate(object sender, EventArgs e) {
Open(file, OpenType.File, false, true);
});
templatesToolStripMenuItem.DropDownItems.Add(mi);
}
parserLabel = new ToolStripLabel("Parser: No file");
parserLabel.Alignment = ToolStripItemAlignment.Right;
MainMenu.Items.Add(parserLabel);
tabControl1.tabsSwapped += delegate(object sender, TabsSwappedEventArgs e) {
TabInfo tmp = tabs[e.aIndex];
tabs[e.aIndex] = tabs[e.bIndex];
tabs[e.aIndex].index = e.aIndex;
tabs[e.bIndex] = tmp;
tabs[e.bIndex].index = e.bIndex;
};
splitContainer2.Panel2Collapsed = !Settings.enableParser;
parserLabel.Visible = Settings.enableParser;
ProgramInfo.LoadOpcodes();
}
示例5: SafeSetText
public void SafeSetText(ToolStripLabel toolStripLabel, string text)
{
if (InvokeRequired)
{
SetText setTextDel = delegate(ToolStripLabel toolStrip, string textVal)
{
foreach (ToolStripItem item in base.Items)
{
if (item == toolStrip)
{
item.Text = textVal;
}
}
};
try
{
Invoke(setTextDel, new object[] { toolStripLabel, text });
}
catch
{
}
}
else
{
foreach (ToolStripItem item in base.Items)
{
if (item == toolStripLabel)
{
item.Text = text;
}
}
}
}
示例6: StatusBar
/// <summary>
/// Конструктор класса
/// </summary>
/// <param name="statusBar">Объект который представляет из себя строку состояния</param>
/// <param name="statusBarLabel">Текст отображаемый в строке состояния</param>
/// <param name="parent">Родительская форма</param>
public StatusBar(System.Windows.Forms.StatusStrip statusBar, ToolStripLabel statusBarLabel, BankLab parent)
{
CurrentStatusBar = statusBar;
StatusBarLabel = statusBarLabel;
Parent = parent;
FindControlsOn(Parent);
}
示例7: SendUserError
public static void SendUserError(string text, string anchor, int displayTime, bool includeBeep, object objin, WorldEditor appin)
{
app = appin;
link = anchor;
if (includeBeep)
{
SystemSounds.Beep.Play();
}
obj = objin;
if (showing == false)
{
showing = true;
toolStripErrorMessage = new ToolStripLabel(text, null, false);
toolStripErrorMessage.ForeColor = Color.Red;
toolStripErrorMessage.Click += toolStripErrorMessage_clicked;
toolStripErrorMessage.IsLink = true;
toolStripErrorMessage.ActiveLinkColor = Color.Red;
toolStripErrorMessage.LinkBehavior = LinkBehavior.AlwaysUnderline;
toolStripErrorMessage.LinkColor = Color.Red;
toolStripErrorMessage.VisitedLinkColor = Color.Red;
toolStripErrorMessageItem = toolStripErrorMessage as ToolStripItem;
app.StatusBarAddItem(toolStripErrorMessageItem);
timeOutErrorMessage(toolStripErrorMessageItem, displayTime);
}
}
示例8: WTrayApp
public WTrayApp()
{
try
{
wmiObj = new AwmiInterface();
}
catch (AwmiException)
{
ShowErrorMsg(Strings.FatalAwmiError, MessageBoxIcon.Error);
Environment.Exit(1);
}
Camera = new DevEntry(Strings.Webcam, OnCameraToggle);
CardReader = new DevEntry(Strings.CardReader, OnCardReaderToggle);
trayMenuStrip = new ContextMenuStrip();
ToolStripLabel lblDevices = new ToolStripLabel(Strings.Devices);
lblDevices.Enabled = false;
ToolStripMenuItem mnuAbout = new ToolStripMenuItem(Strings.About, null, OnAbout);
ToolStripMenuItem mnuExit = new ToolStripMenuItem(Strings.Exit, null, OnExit);
trayMenuStrip.Items.Add(lblDevices);
trayMenuStrip.Items.Add(Camera.MenuItem);
trayMenuStrip.Items.Add(CardReader.MenuItem);
trayMenuStrip.Items.Add(new ToolStripSeparator());
trayMenuStrip.Items.Add(mnuAbout);
trayMenuStrip.Items.Add(mnuExit);
trayIcon = new NotifyIcon();
trayIcon.Text = Strings.WTrayName;
trayIcon.Icon = new Icon(Icons.WTray, 40, 40);
trayIcon.ContextMenuStrip = trayMenuStrip;
trayIcon.Visible = true;
RefreshDeviceStatus();
}
示例9: 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));
}
示例10: LogBox
public LogBox()
{
InitializeComponent();
_reportLink = new ToolStripLabel("Report this problem to the developers");
_reportLink.LinkColor = Color.Red;
_reportLink.IsLink = true;
_reportLink.Visible = false;
menuStrip1.Items.Add(_reportLink);
_reportLink.Click += delegate
{
if (!ReportError(_verboseBox.Text))
{
try
{
if (!string.IsNullOrEmpty(_verboseBox.Text))
{
Clipboard.SetText(_verboseBox.Text);
MessageBox.Show(
"Information on what happened has been copied to your clipboard. Please email it to the developers of the program you are using.");
}
}
catch (Exception)
{
MessageBox.Show(
"Unable to copy the message to the clipboard. You might need to restart the application or your computer");
}
}
if (ReportErrorLinkClicked != null)
ReportErrorLinkClicked(this, EventArgs.Empty);
};
_verboseBox.ForeColor = _box.ForeColor = SystemColors.WindowText;
_verboseBox.BackColor = _box.BackColor = SystemColors.Window;
menuStrip1.BackColor = Color.White;
BackColor = VisualStyleInformation.TextControlBorder;
_tableLayout.BackColor = SystemColors.Window;
//On some machines (winXP?) we get in trouble if we don't make sure these boxes are visible before
//they get invoked() to. It's not clear that the following actually works... in addition to this
//effort, we also catch exceptions when in trying to invoke on them.
_box.CreateControl();
_verboseBox.Visible = true;
_verboseBox.CreateControl();
_verboseBox.Visible = false;
SetFont();
_tableLayout.Size = new Size(ClientSize.Width - (_tableLayout.Left + 1),
ClientSize.Height - (_tableLayout.Top + 1));
_box.Dock = DockStyle.Fill;
_box.LinkClicked += _box_LinkClicked;
_verboseBox.LinkClicked += _box_LinkClicked;
_synchronizationContext = SynchronizationContext.Current;
}
示例11: ProviderPatternTest
public void ProviderPatternTest ()
{
ToolStripLabel menuItem = new ToolStripLabel ();
VerifyPatterns (menuItem, false);
menuItem = new ToolStripLabel ();
menuItem.IsLink = true;
VerifyPatterns (menuItem, true);
}
示例12: NodeContextMenu
public NodeContextMenu(SchemaTree tree, RepositoryNode node)
{
EventHandler onClick = null;
this._tree = tree;
this._node = node;
if ((node.Repository.DriverLoader.InternalID == null) && node.Repository.DriverLoader.IsValid)
{
ToolStripLabel label = new ToolStripLabel("Custom driver: " + node.Repository.DriverLoader.Driver.Name);
this.Items.Add(label);
this.Items.Add("-");
label.Font = new Font(label.Font, FontStyle.Bold);
}
if (node.Repository.IsQueryable)
{
this.Items.Add("New Query", Resources.New, new EventHandler(this.NewQuery));
this.Items.Add("-");
if ((MainForm.Instance != null) && (MainForm.Instance.CurrentQueryControl != null))
{
this.Items.Add("Use in Current Query", Resources.UseCurrentQuery, (sender, e) => MainForm.Instance.CurrentQueryControl.UseCurrentDb(false));
if (MainForm.Instance.CurrentQueryControl.Query.Repository == node.Repository)
{
this.Items[this.Items.Count - 1].Enabled = false;
}
this.Items.Add("-");
}
if (MainForm.Instance != null)
{
if (onClick == null)
{
onClick = (sender, e) => MainForm.Instance.ClearAllConnections(node.Repository);
}
this.Items.Add("Close all connections", null, onClick);
this.Items.Add("-");
}
}
this.Items.Add("Refresh", Resources.Refresh, new EventHandler(this.Refresh));
if (node.Parent == null)
{
this.Items.Add("Delete Connection", Resources.Delete, new EventHandler(this.Delete));
}
if (!((this._node.Repository.DriverLoader.SimpleAssemblyName != null) && this._node.Repository.DriverLoader.SimpleAssemblyName.StartsWith("Mindscape.LightSpeed", StringComparison.InvariantCultureIgnoreCase)) && (this._node.Repository.Parent == null))
{
this.Items.Add("-");
this.Items.Add("Rename Connection", null, new EventHandler(this.Rename));
if (!string.IsNullOrEmpty(this._node.Repository.DisplayName))
{
this.Items.Add("Reset Connection Name", null, new EventHandler(this.ResetName));
}
}
if (node.Parent == null)
{
this.Items.Add("Create Similar Connection...", null, new EventHandler(this.CreateSimilar));
this.Items.Add("-");
this.Items.Add("Properties", Resources.AdvancedProperties, new EventHandler(this.Edit));
}
}
示例13: AddToolStripLabel
void AddToolStripLabel(string labelText)
{
ToolStripLabel label = new ToolStripLabel
{
Text = labelText,
Font = new Font(Font, FontStyle.Bold | FontStyle.Underline)
};
toolStrip.Items.Add(label);
}
示例14: SetUp
public override void SetUp ()
{
base.SetUp ();
strip = new ToolStrip ();
item = new ToolStripLabel ();
strip.Items.Add (item);
Form.Controls.Add (strip);
Form.Show ();
}
示例15: 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();
}