本文整理匯總了C#中System.Windows.Forms.StatusBar.DrawItem事件的典型用法代碼示例。如果您正苦於以下問題:C# StatusBar.DrawItem事件的具體用法?C# StatusBar.DrawItem怎麽用?C# StatusBar.DrawItem使用的例子?那麽, 這裏精選的事件代碼示例或許可以為您提供幫助。您也可以進一步了解該事件所在類System.Windows.Forms.StatusBar
的用法示例。
在下文中一共展示了StatusBar.DrawItem事件的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawMyPanel
private void DrawMyPanel(object sender, System.Windows.Forms.StatusBarDrawItemEventArgs sbdevent)
{
// Create a StringFormat object to align text in the panel.
StringFormat sf = new StringFormat();
// Format the String of the StatusBarPanel to be centered.
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
// Draw a black background in owner-drawn panel.
sbdevent.Graphics.FillRectangle(Brushes.Black, sbdevent.Bounds);
// Draw the current date (short date format) with white text in the control's font.
sbdevent.Graphics.DrawString(DateTime.Today.ToShortDateString(),
statusBar1.Font,Brushes.White,sbdevent.Bounds,sf);
}