本文整理汇总了C#中System.Windows.Forms.StatusBarPanel类的典型用法代码示例。如果您正苦于以下问题:C# StatusBarPanel类的具体用法?C# StatusBarPanel怎么用?C# StatusBarPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StatusBarPanel类属于System.Windows.Forms命名空间,在下文中一共展示了StatusBarPanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: StatusBarDrawItemEventArgs
public StatusBarDrawItemEventArgs (Graphics g, Font font, Rectangle r,
int itemId, DrawItemState itemState, StatusBarPanel panel) :
this (g, font, r, itemId, itemState, panel, Control.DefaultForeColor,
Control.DefaultBackColor)
{
}
示例3: 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);
}
示例4: base
// Constructors.
public StatusBarDrawItemEventArgs
(Graphics graphics, Font font, Rectangle rect,
int index, DrawItemState state, StatusBarPanel panel)
: base(graphics, font, rect, index, state)
{
this.panel = panel;
}
示例5: PresentationStatusBar
/// <summary>
/// I like status bars. Status bars are good.
/// </summary>
public PresentationStatusBar()
{
// Pri4: It occurs to me that messages on a status bar can be much like a stack in
// that a new message can occur when one is already being displayed. Maybe we should
// make a nice statusBar that has a built-in stack to push & pop messages (as well
// as clear the stack).
this.ShowPanels = true;
messagePanel = new StatusBarPanel();
messagePanel.Style = StatusBarPanelStyle.Text;
messagePanel.BorderStyle = StatusBarPanelBorderStyle.Sunken;
messagePanel.AutoSize = StatusBarPanelAutoSize.Spring;
pagePanel = new StatusBarPanel();
pagePanel.Style = StatusBarPanelStyle.Text;
pagePanel.BorderStyle = StatusBarPanelBorderStyle.Sunken;
pagePanel.AutoSize = StatusBarPanelAutoSize.Contents;
pagePanel.Alignment = HorizontalAlignment.Center;
pagePanel.MinWidth = 100;
pagePanel.Text = Strings.Slide_Of_Placeholder;
this.Panels.Add(messagePanel);
this.Panels.Add(pagePanel);
}
示例6: base
// Constructor.
public StatusBarPanelClickEventArgs
(StatusBarPanel statusBarPanel, MouseButtons button,
int clicks, int x, int y)
: base(button, clicks, x, y, 0)
{
this.statusBarPanel = statusBarPanel;
}
示例7: MinimumWidth2
public void MinimumWidth2 ()
{
StatusBarPanel p = new StatusBarPanel ();
p.Width = 50;
p.MinWidth = 100;
Assert.AreEqual (100, p.Width, "1");
}
示例8: 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") ;
}
示例9: 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);
}
示例10: ToolArgs
public ToolArgs(Bitmap bmp, PictureBox picBox, StatusBarPanel p1, StatusBarPanel p2, IPaintSettings settings)
{
bitmap = bmp;
pictureBox = picBox;
panel1 = p1;
panel2 = p2;
this.settings = settings;
}
示例11: InitializeControls
// Sets up the status bar and other controls.
private void InitializeControls()
{
// Set up the status bar.
StatusBarPanel panel = new StatusBarPanel();
panel.BorderStyle = StatusBarPanelBorderStyle.Sunken;
panel.Text = "Ready.";
panel.AutoSize = StatusBarPanelAutoSize.Spring;
this.statusBar.ShowPanels = true;
this.statusBar.Panels.Add(panel);
}
示例12: ToStringTest
public void ToStringTest ()
{
StatusBarPanel p = new StatusBarPanel ();
Assert.AreEqual ("StatusBarPanel: {}", p.ToString(), "1");
p.Text = "Hello";
Assert.AreEqual ("StatusBarPanel: {Hello}", p.ToString(), "2");
p.Text = "}";
Assert.AreEqual ("StatusBarPanel: {}}", p.ToString(), "3");
}
示例13: AddPanels
public void AddPanels()
{
for ( int i=0; i<6; i++)
{
StatusBarPanel panel = new StatusBarPanel();
panel.BorderStyle = StatusBarPanelBorderStyle.Sunken;
panel.AutoSize = StatusBarPanelAutoSize.Contents;
Panels.Add(panel);
}
}
示例14: MainForm
public MainForm(ITileProvider floorTileProvider, ITileProvider objectTileProvider)
{
this.floorTileProvider = floorTileProvider;
this.objectTileProvider = objectTileProvider;
// tileBrowserForm = new TileBrowserForm(floorTileProvider, objectTileProvider);
mapView = new MapView(this);
Controls.Add(mapView);
Text = "Aesir";
DataBindings.Add(new Binding("Size", settings, "FormSize", true,
DataSourceUpdateMode.OnPropertyChanged));
DataBindings.Add(new Binding("Location", settings, "FormLocation", true,
DataSourceUpdateMode.OnPropertyChanged));
MainMenu menu = new MainMenu();
MenuItem[] fileItems = new MenuItem[] {
new MenuItem("New"),
new MenuItem("Open"),
new MenuItem("Save")
};
menu.MenuItems.Add(new MenuItem("&File", fileItems));
Menu = menu;
StatusBarPanel panel = new StatusBarPanel();
panel.BorderStyle = StatusBarPanelBorderStyle.Sunken;
panel.AutoSize = StatusBarPanelAutoSize.Spring;
panel.Text = "Ready";
statusBar.Panels.Add(panel);
statusBar.ShowPanels = true;
Controls.Add(statusBar);
//tileBrowserForm.Show();
toolStrip.Renderer = new ToolStripSystemRenderer();
Label label = new Label();
label.Text = "LOL";
toolStrip.Items.Add(new ToolStripControlHost(label));
toolStrip.Items.Add(new ToolStripButton("Pencil"));
toolStrip.Items.Add(new ToolStripButton("Line"));
toolStrip.Items.Add(new ToolStripButton("Square"));
Controls.Add(toolStrip);
testForm = new Form();
FloorTileBrowser shit = new FloorTileBrowser(floorTileProvider);
shit.Dock = DockStyle.Fill;
testForm.Controls.Add(shit);
testForm.Show();
// TEMP: stuff
/*mapView.PaintWorldOverlay += delegate(object sender, PaintEventArgs args) {
Console.WriteLine(mapView.VectorToTile(mousePosition));
args.Graphics.DrawRectangle(Pens.Blue, new Rectangle((Point)(mapView.VectorToTile(mousePosition) * (Vector)Tile.Size), Tile.Size));
};
mapView.MouseMove += delegate(object sender, MouseEventArgs args) {
mousePosition = (Vector)args.Location;
mapView.Refresh();
};*/
}
示例15: MainForm
/// <summary>
/// Konstruktor klasy MainForm.
/// </summary>
public MainForm()
{
// Konfiguruję ustawienia okna.
Size = new Size(1050, 600);
Location = new Point(0, 0);
Text = "Serwer komunikatora internetowego e-Talk";
// Tworzę komponenty okna głównego:
// - menu główne
menu = new MainMenu();
// - komponenty menu głównego
m1 = new MenuItem("Ustawienia");
menu.MenuItems.Add(m1);
m3 = new MenuItem("O programie", new EventHandler(MMAboutClick), Shortcut.CtrlA);
m3.Select += new EventHandler(MMAboutSelect);
menu.MenuItems.Add(m3);
m2 = new MenuItem("Wyjście", new EventHandler(MMWyjscieClick), Shortcut.CtrlW);
m2.Select += new EventHandler(MMExitSelect);
menu.MenuItems.Add(m2);
// - podmenu ustawień
subm1 = new MenuItem("Połącz z bazą", new EventHandler(MMLoginClick), Shortcut.CtrlL);
subm1.Select += new EventHandler(MMLoginSelect);
m1.MenuItems.Add(subm1);
subm2 = new MenuItem("Nasłuchuj", new EventHandler(MMListenClick), Shortcut.CtrlN);
subm2.Select += new EventHandler(MMListenSelect);
subm2.Visible = false;
m1.MenuItems.Add(subm2);
// Tworzę panel pomocniczego tekstu.
menuTextProvider1 = new StatusBarPanel();
menuTextProvider1.Name = "menuTextProvider1";
menuTextProvider1.Width = Size.Width / 2 + Size.Width / 8;
menuTextProvider1.Text = "";
// Przypisuję utworzone menu.
Menu = menu;
// Dodaję dolny panel.
BuildTimerHelpBar();
// Dodaję wewnętrzne komponenty.
BuildInnerComponents();
}