本文整理汇总了C#中System.Windows.Forms.StatusBar类的典型用法代码示例。如果您正苦于以下问题:C# StatusBar类的具体用法?C# StatusBar怎么用?C# StatusBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StatusBar类属于System.Windows.Forms命名空间,在下文中一共展示了StatusBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'project_MDataSet.tblLanguage' table. You can move, or remove it, as needed.
this.tblLanguageTableAdapter.Fill(this.project_MDataSet.tblLanguage);
Language File = new Language();
Language Exit = new Language();
Language Settings = new Language();
Language Users = new Language();
Language Options = new Language();
fileToolStripMenuItem.Text = File.getWord("File");
exitToolStripMenuItem.Text = Exit.getWord("Exit");
settingsToolStripMenuItem.Text = Settings.getWord("Settings");
usersToolStripMenuItem.Text = Users.getWord("Users");
optionsToolStripMenuItem.Text = Options.getWord("Options");
loginform.ControlBox = false;
loginform.ShowDialog();
StatusBar mainStatusBar = new StatusBar();
StatusBarPanel timeStatusBar = new StatusBarPanel();
StatusBarPanel userloggedinStatusBar = new StatusBarPanel();
timeStatusBar.Text = System.DateTime.Today.ToShortDateString();
userloggedinStatusBar.Text = loginform.UserNameString;
mainStatusBar.Panels.Add(userloggedinStatusBar);
mainStatusBar.Panels.Add(timeStatusBar);
mainStatusBar.ShowPanels = true;
Controls.Add(mainStatusBar);
}
示例2: StatusBarShowPanelsTest
public void StatusBarShowPanelsTest ()
{
StatusBar sb = new StatusBar ();
sb.ShowPanels = true;
sb.Text = "Test";
Assert.AreEqual ("Test", sb.Text, "#01");
}
示例3: StatusBarTextBox
/// ------------------------------------------------------------------------------------
/// <summary>
/// constructor
/// </summary>
/// <param name="bar">Needed because the parent attr is null at this point</param>
/// ------------------------------------------------------------------------------------
public StatusBarTextBox(StatusBar bar): base()
{
Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw;
m_backBrush = System.Drawing.Brushes.Transparent;
bar.DrawItem += new StatusBarDrawItemEventHandler(HandleDrawItem);
m_bar = bar;
}
示例4: InitializeComponents
private void InitializeComponents()
{
Panel p = new Panel();
p.Location = new Point(30, 120);
p.Parent = this;
// TextBox tb = new TextBox();
// tb.Parent = this;
// tb.Dock = DockStyle.Fill;
// tb.Location = new Point(400, 400);
TreeView tv = new TreeView();
tv.Location = new Point(30, 120);
TreeNode child1 = new TreeNode("Python");
TreeNode child2 = new TreeNode("Ruby");
TreeNode child3 = new TreeNode("Java");
TreeNode[] array = new TreeNode[] { child1, child2, child3 };
TreeNode root = new TreeNode("Languages", array);
tv.Nodes.Add(root);
tv.Dock = DockStyle.Fill;
tv.AfterSelect += new TreeViewEventHandler(AfterSelect);
tv.Parent = this;
statusbar = new StatusBar();
statusbar.Parent = this;
// ToolBar toolbar = new ToolBar();
// toolbar.Buttons.Add(new ToolBarButton());
// toolbar.ButtonClick += new ToolBarButtonClickEventHandler(OnClicked);
// Controls.Add(toolbar);
}
示例5: Create
public static void Create (Form Parent)
{ StatusBar Instance = new StatusBar () ;
Instance.Parent = Parent ;
Parent.Controls.Add (Instance) ;
Panel = new StatusBarPanel () ;
Panel.BorderStyle = StatusBarPanelBorderStyle.Sunken ;
Panel.AutoSize = StatusBarPanelAutoSize.Spring ;
Rect1 = new StatusBarPanel () ;
Rect1.BorderStyle = StatusBarPanelBorderStyle.Sunken ;
Rect1.Width = 70 ;
Rect1.Alignment = HorizontalAlignment.Center ;
Rect2 = new StatusBarPanel () ;
Rect2.BorderStyle = StatusBarPanelBorderStyle.Sunken ;
Rect2.Width = 70 ;
Rect2.Alignment = HorizontalAlignment.Center ;
Instance.ShowPanels = true ;
Instance.Panels.Add (Panel) ;
Instance.Panels.Add (Rect1) ;
Instance.Panels.Add (Rect2) ;
ShowText (" Ready") ;
}
示例6: Form1
public Form1()
{
Status = new StatusBar();
Status.Parent = this;
Status.Text = "Obrana pevnosti";
InitializeComponent();
ManazerHry = new Manazer();
SeznamPolozekObtiznosti = new ToolStripMenuItem[] {
this.snadnáToolStripMenuItem,
this.normálníToolStripMenuItem,
this.těžkáToolStripMenuItem };
SeznamPolozekMoznosti = new ToolStripMenuItem[] {
this.zpětToolStripMenuItem,
this.vpředToolStripMenuItem,
this.prohoďHráčeToolStripMenuItem,
this.nejlepšíTahToolStripMenuItem,
this.přehrátToolStripMenuItem
};
Utocnik = Image.FromFile("savle_maly.png");
Obrance = Image.FromFile("stit_maly.png");
Manazer.AktualizaceUI = AktualizujGUI;
Manazer.AkcePoKonciHry = OznameniKonceHry;
Manazer.AktualizaceHistorie = AktualizujPanelHistorie;
}
示例7: Test1
public Test1 ()
{
Button btn = new Button ();
btn.Text = "Click Me";
btn.Click += new EventHandler (button_clicked);
Controls.Add (btn);
StatusBar sb1;
sb1 = new StatusBar ();
sb1.Width = 300;
sb1.ShowPanels = true;
Controls.Add (sb1);
StatusBarPanel p = new StatusBarPanel ();
p.AutoSize = StatusBarPanelAutoSize.Spring;
p.Text = "Clicks: 0";
sb1.Panels.Add (p);
clicks_panel = p;
StatusBarPanel p2 = new StatusBarPanel ();
p2.AutoSize = StatusBarPanelAutoSize.Contents;
p2.Text = "i am an apeman";
sb1.Panels.Add (p2);
StatusBarPanel p3 = new StatusBarPanel ();
p3.Alignment = HorizontalAlignment.Right;
p3.AutoSize = StatusBarPanelAutoSize.Spring;
p3.Text = "test";
sb1.Panels.Add (p3);
mouse_panel = p3;
MouseMove += new MouseEventHandler (mouse_moved);
}
示例8: InitializeComponent
private void InitializeComponent()
{
this.testLabel = new System.Windows.Forms.Label();
testLabel.Text = "test";
this.statBar = new System.Windows.Forms.StatusBar();
this.msgPanel = new System.Windows.Forms.StatusBarPanel();
((System.ComponentModel.ISupportInitialize)(this.msgPanel)).BeginInit();
this.SuspendLayout();
this.statBar.Location = new System.Drawing.Point(0, 400);
this.statBar.Name = "statBar";
this.statBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.msgPanel
});
this.statBar.ShowPanels = true;
this.statBar.Size = new System.Drawing.Size(536, 22);
this.statBar.TabIndex = 0;
this.statBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statBar_DrawItem);
this.Controls.Add(this.statBar);
//
// msgPanel
//
this.msgPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
this.msgPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw;
this.msgPanel.Width = 341;
this.Controls.Add(this.statBar);
((System.ComponentModel.ISupportInitialize)(this.msgPanel)).EndInit();
this.ResumeLayout(false);
}
示例9: ApplicationWindow
public ApplicationWindow()
{
this.Icon = new Icon(this.GetType().Assembly.GetManifestResourceStream("Resourcer.Application.ico"));
this.Font = new Font("Tahoma", 8.25f);
this.Text = (this.GetType().Assembly.GetCustomAttributes(typeof(System.Reflection.AssemblyTitleAttribute), false)[0] as System.Reflection.AssemblyTitleAttribute).Title;
this.Size = new Size(480, 600);
this.MinimumSize = new Size (240, 300);
this.resourceBrowser = new ResourceBrowser();
this.resourceBrowser.Dock = DockStyle.Fill;
this.Controls.Add(this.resourceBrowser);
this.verticalSplitter = new Splitter ();
this.verticalSplitter.Dock = DockStyle.Bottom;
this.verticalSplitter.BorderStyle = BorderStyle.None;
this.Controls.Add(this.verticalSplitter);
this.resourceViewer = new ResourcerViewer();
this.resourceViewer.Dock = DockStyle.Bottom;
this.resourceViewer.Height = 100;
this.Controls.Add(this.resourceViewer);
this.statusBar = new StatusBar();
this.Controls.Add(this.statusBar);
this.commandBarManager = new CommandBarManager();
this.menuBar = new CommandBar(this.commandBarManager, CommandBarStyle.Menu);
this.commandBarManager.CommandBars.Add(this.menuBar);
this.toolBar = new CommandBar(this.commandBarManager, CommandBarStyle.ToolBar);
this.commandBarManager.CommandBars.Add(this.toolBar);
this.Controls.Add(this.commandBarManager);
}
示例10: 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.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
this.statusBar = new System.Windows.Forms.StatusBar();
this.splitter3 = new System.Windows.Forms.Splitter();
this.dockPanel1 = new WeifenLuo.WinFormsUI.DockPanel();
this.timerExternallyModifiedFiles = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// statusBar
//
this.statusBar.Location = new System.Drawing.Point(0, 459);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(758, 21);
this.statusBar.TabIndex = 6;
//
// splitter3
//
this.splitter3.Dock = System.Windows.Forms.DockStyle.Bottom;
this.splitter3.Location = new System.Drawing.Point(0, 456);
this.splitter3.Name = "splitter3";
this.splitter3.Size = new System.Drawing.Size(758, 3);
this.splitter3.TabIndex = 21;
this.splitter3.TabStop = false;
//
// dockPanel1
//
this.dockPanel1.ActiveAutoHideContent = null;
this.dockPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dockPanel1.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
this.dockPanel1.Location = new System.Drawing.Point(0, 0);
this.dockPanel1.Name = "dockPanel1";
this.dockPanel1.Size = new System.Drawing.Size(758, 456);
this.dockPanel1.TabIndex = 23;
//
// timerExternallyModifiedFiles
//
this.timerExternallyModifiedFiles.Interval = 200;
this.timerExternallyModifiedFiles.Tick += new System.EventHandler(this.timerExternallyModifiedFiles_Tick);
//
// MainForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(758, 480);
this.Controls.Add(this.dockPanel1);
this.Controls.Add(this.splitter3);
this.Controls.Add(this.statusBar);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.IsMdiContainer = true;
this.Name = "MainForm";
this.Text = "CH3ETAH";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Closing += new System.ComponentModel.CancelEventHandler(this.Form_Closing);
this.Load += new System.EventHandler(this.MainForm_Load);
this.Activated += new System.EventHandler(this.MainForm_Activated);
this.Deactivate += new System.EventHandler(this.MainForm_Deactivate);
this.ResumeLayout(false);
}
示例11: StatusBarTextTest
public void StatusBarTextTest ()
{
string a = new string ('a', 127);
string ab = a + "b";
StatusBar sb = new StatusBar();
sb.Text = ab;
Assert.AreEqual (ab, sb.Text, "#01");
}
示例12: CAForm
public CAForm()
{
// CONSTRUCTOR
DoubleBuffered = true;
Text = "CA 2011";
Size = new Size(WIDTH, HEIGHT);
ToolTip tooltip = new ToolTip();
tooltip.SetToolTip(this, "Click or draw to add cells!");
Bitmap bm;
try {
bm = LoadBitmap("bgr.jpg");
} catch (Exception) {
bm = CreateBitmap(SP_WIDTH, SP_HEIGHT);
}
caController = new Controller(bm, bm.Width, bm.Height); // ClientSize.Width, ClientSize.Height);
ResizeRedraw = true;
Graphics gf = CreateGraphics();
gf.DrawImageUnscaled(caController.Surface, 0, 0);
//Bitmap shade = new Bitmap(ClientSize.Width, 50);
//Graphics g = Graphics.FromImage(shade);
//Brush b = new SolidBrush(Color.FromArgb(20, 200, 200, 200));
//gf.FillRectangle(b, new Rectangle(0, 0, ClientSize.Width, 50));
//g.DrawImageUnscaled(shade, 0, 0);
//g.Dispose();
//Graphics gs = CreateGraphics();
//gf.DrawImageUnscaled(shade, 0, 0);
tmr = new Timer();
tmr.Enabled = false;
tmr.Interval = 50;
tmr.Tick += new EventHandler(HandleTick);
if (!caController.Calc.GradientTest) {
//tmr.Start();
}
Panel p = new Panel();
p.Width = ClientSize.Width - bm.Width;
p.Dock = DockStyle.Right;
p.Parent = this;
Button startButton = new Button();
startButton.Text = "Start";
startButton.Location = new Point(p.Width - startButton.Width - 10, 20);
startButton.Anchor = AnchorStyles.Right;
startButton.Click += new EventHandler(OnStartClick);
startButton.Parent = p;
sb = new StatusBar();
sb.Parent = this;
sb.Text = "Generations: 0";
caController.Calc.PropertyChanged += new PropertyChangedEventHandler(OnGenerationsChanged);
//Controls.Add();
CenterToScreen();
}
示例13: ProgressStatusBarPanel
/// <summary>
/// Constructs a new instance of the <see cref="ProgressStatusBarPanel"/> class
/// and initializes it with the default values.
/// </summary>
/// <param name="sb">The status bar that contains the progress bar</param>
public ProgressStatusBarPanel(StatusBar sb)
{
//Allow custom drawing
this.Style = StatusBarPanelStyle.OwnerDraw;
//Set the color
this.ForeColor = Color.RoyalBlue;//SystemColors.Highlight;
this.minimum = 0;
this.maximum = 100;
this.value = 0;
this.brush = new SolidBrush(foreColor);//System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(sbdevent.Bounds.X+1, sbdevent.Bounds.Y+1, barWidth, sbdevent.Bounds.Height-2),ForeColor,Color.Red,System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
//Add a listener for the Draw event
sb.DrawItem += new StatusBarDrawItemEventHandler(sb_DrawItem);
}
示例14: ProviderPatternTest
public void ProviderPatternTest ()
{
StatusBar statusBar = new StatusBar ();
IRawElementProviderSimple provider =
ProviderFactory.GetProvider (statusBar);
object gridProvider =
provider.GetPatternProvider (GridPatternIdentifiers.Pattern.Id);
Assert.IsNotNull (gridProvider,
"Not returning GridPatternIdentifiers.");
Assert.IsTrue (gridProvider is IGridProvider,
"Not returning GridPatternIdentifiers.");
}
示例15: 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() {
ResourceManager resources = new ResourceManager(typeof (MainForm));
statusBar = new StatusBar();
splitter3 = new Splitter();
dockPanel1 = new DockPanel();
SuspendLayout();
//
// statusBar
//
statusBar.Location = new Point(0, 459);
statusBar.Name = "statusBar";
statusBar.Size = new Size(758, 21);
statusBar.TabIndex = 6;
//
// splitter3
//
splitter3.Dock = DockStyle.Bottom;
splitter3.Location = new Point(0, 456);
splitter3.Name = "splitter3";
splitter3.Size = new Size(758, 3);
splitter3.TabIndex = 21;
splitter3.TabStop = false;
//
// dockPanel1
//
dockPanel1.ActiveAutoHideContent = null;
dockPanel1.Dock = DockStyle.Fill;
dockPanel1.Font = new Font("Tahoma", 11F, FontStyle.Regular, GraphicsUnit.World);
dockPanel1.Location = new Point(0, 0);
dockPanel1.Name = "dockPanel1";
dockPanel1.Size = new Size(758, 456);
dockPanel1.TabIndex = 23;
//
// MainForm
//
AutoScaleBaseSize = new Size(5, 13);
ClientSize = new Size(758, 480);
Controls.Add(dockPanel1);
Controls.Add(splitter3);
Controls.Add(statusBar);
Icon = ((Icon) (resources.GetObject("$this.Icon")));
IsMdiContainer = true;
Name = "MainForm";
Text = "CH3ETAH";
WindowState = FormWindowState.Maximized;
Closing += new CancelEventHandler(Form_Closing);
Load += new EventHandler(MainForm_Load);
ResumeLayout(false);
}