How can i put a ProgressBar object into panel of Statusbar
Please, give me an example ... in VB.NET
Thanks in advance.
Gislain ROCHE
Check out the MSDN TV episode Windows forms and the "poor boy's"
progress bar.
http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20030411WinFormsMB/manifest.xml
Ken
-------------------
"Gislain" <nos...@nospam.fr> wrote in message
news:OiYN3jxC...@TK2MSFTNGP12.phx.gbl...
ProgressPanel.AutoSize = StatusBarPanelAutoSize.Spring
pbar.Value = 100
pbar.Height = sb.Height - 3
pbar.Width = sb.Panels.Item(1).Width
'This places it in the second Panel.
pbar.Location = New Point(sb.Panels.Item(0).Width + 2.5, 3)
pbar.Parent = sb
pbar.Refresh()
sb.Panels.Item(1).AutoSize = StatusBarPanelAutoSize.Contents
sb.Refresh()
Seth
"Gislain" <nos...@nospam.fr> wrote in message
news:OiYN3jxC...@TK2MSFTNGP12.phx.gbl...
"Gislain" <nos...@nospam.fr> schrieb:
> How can i put a ProgressBar object into panel of Statusbar
> Please, give me an example ... in VB.NET
Sorry, it's C#:
\\\
using System.Windows.Forms;
using System;
using System.Drawing;
class MyApp : Form
{
ProgressBar pbar = new ProgressBar();
StatusBarPanel ProgressPanel = new StatusBarPanel();
public MyApp() {
StatusBar sb = new StatusBar();
sb.Parent = this;
sb.ShowPanels = true;
StatusBarPanel panel1 = new StatusBarPanel();
panel1.AutoSize = StatusBarPanelAutoSize.Contents;
panel1.Text = "Mein Text";
sb.Panels.Add(panel1);
ProgressPanel .AutoSize = StatusBarPanelAutoSize.Spring;
sb.Panels.Add(ProgressPanel );
pbar.Value = 30;
pbar.Parent = sb;
pbar.Width = ProgressPanel.Width;
pbar.Location = new Point(panel1.Width, 0);
}
protected override void OnResize(EventArgs ea)
{
base.OnResize(ea);
pbar.Width = ProgressPanel.Width;
}
public static void Main()
{
MyApp f = new MyApp();
f.ShowDialog();
}
}
///
An other approach (VB .NET):
http://makeashorterlink.com/?P28351704
No X-Posts. Thanks!
Regards,
Herfried K. Wagner