Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ProgressBar into Panel of StatusBar

8 views
Skip to first unread message

Gislain

unread,
Apr 25, 2003, 6:54:17 AM4/25/03
to
Hi,

How can i put a ProgressBar object into panel of Statusbar
Please, give me an example ... in VB.NET

Thanks in advance.

Gislain ROCHE


Ken Tucker

unread,
Apr 25, 2003, 7:20:04 AM4/25/03
to
Hi,

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...

Seth Bembeneck

unread,
Apr 25, 2003, 8:54:25 AM4/25/03
to
Here is what I have come up with sofar...

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...

Herfried K. Wagner

unread,
Apr 25, 2003, 9:12:29 AM4/25/03
to
Hello,

"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


0 new messages