 |
|
 |
i think you are just having fun, this's not advanced at all, i don't think any one will like an application with a progressbar that looks like those!
|
|
|
|
 |
|
 |
How can i make a trapezium shaped progressbar with the same controls like the advanced progressbar
|
|
|
|
 |
|
 |
it`s pretty easy to do it, just have a look at the code.
what you need to do is create your own progressbar shape that will look like a trapezium, just add the coordinates that you need and that`s it.
Gil
|
|
|
|
 |
|
 |
The control was working well when I was using VS2003 and .NET 1.1. I have just switched to VS2005/.Net 2.0 and the percent text is not centralized.
I have tried to make to modifications to fix it. Here is the code:
private void DrawPercent(Graphics G)
{
// very ugly way to do it, but it works well
Label PercentLabel = new Label();
PercentLabel.AutoSize = true;
PercentLabel.Font = this.Font;
PercentLabel.Text = _Position.ToString() + "%";
SizeF TextSize = G.MeasureString(PercentLabel.Text, this.Font);
float left = this.ClientRectangle.X + (this.ClientRectangle.Width - TextSize.Width) / 2;
float top = this.ClientRectangle.Y + (this.ClientRectangle.Height - TextSize.Height) / 2;
SolidBrush mTextBrush = new SolidBrush(this.ForeColor);
G.DrawString(PercentLabel.Text, this.Font, mTextBrush, left, top);
mTextBrush.Dispose();
}
|
|
|
|
 |
|
 |
Hi
i'm sending a fixed .Net 2.0 version right now but you can change this function to:
private void DrawPercent(Graphics G)
{
SizeF TextSize = G.MeasureString(Text,Font);
SolidBrush TextBrush = new SolidBrush(ForeColor);
float Left, Top;
Left = (Width - TextSize.Width) / 2;
Top = (Height - TextSize.Height) / 2;
G.DrawString(
Text,
Font,
TextBrush,
new PointF(Left, Top));
TextBrush.Dispose();
}
also update this propertie:
public int Position
{
get { return _Position; }
set
{
if (value > 100) return;
if (value < 0) return;
_Position = value;
Text = _Position + "%";
this.Invalidate();
}
}
thanks for the commet.. Gil
|
|
|
|
 |
|
 |
Hello, I threw together a quick app to test your progress bar. Here's my code that deals with the progress bar:
Me.ProgressBar1.Value = CInt(Me.dblPercentage)
Me.AdvancedProgressBar1.Position = Me.ProgressBar1.Value
The percentage and position doesn't show any change until the end of my loop. Am I doing something wrong?
Here's a screenshot.
Thanks
|
|
|
|
 |
|
 |
I've also just tried += 1 and still same result.
|
|
|
|
 |
|
 |
try adding this:
Me.AdvancedProgressBar1.Invalidate()
after you change the value
|
|
|
|
 |
|
 |
I still get the same result.
|
|
|
|
 |
|
 |
can you send me the source?
|
|
|
|
 |
|
 |
Yes, I can. Thanks for your help! It will be tonight before I can though as I'll need my laptop to get the files.
|
|
|
|
 |
|
 |
Have you received my source?
Thanks
|
|
|
|
 |
|
|
 |
|
 |
Please check you hotmail as it was inserted into a mail message when you replied.
Thanks
|
|
|
|
 |
|
 |
found it .. it was in the spam folder..
anyway all you have to do is change
Me.AdvancedProgressBar1.Invalidate()
with
Me.AdvancedProgressBar1.Refresh()
(even that when you change the AdvancedProgressBar.Position value it already calls Refresh() .. weird)
btw this would make you code very slow couse it makes it redraw anyway so you need to change that whole block to
If Not CInt(Me.dblPercentage) = Me.AdvancedProgressBar1.Position Then
Me.ProgressBar1.Value = CInt(Me.dblPercentage)
Me.AdvancedProgressBar1.Position = Me.ProgressBar1.Value
Me.AdvancedProgressBar1.Refresh()
End If
that's all bye
|
|
|
|
 |
|
 |
hello
i can not use this DLL in VB.NET
help me
thanks
bye
|
|
|
|
 |
|
 |
hi
i can't really understand you commet becouse "i can not use this DLL in VB.NET" doesn't say a thing (where is the problem), i tried loading this dll in VB (into the toolbox by right clicking Add/Remove Items -> Browse -> select the AdvancedProgressBar dll) and it worked just fine..
also check if you are using VB 6 which isn't .NET this might cause you the problem
|
|
|
|
 |
|
 |
hi
when customizae toolbox this error appear ????
http://aminir.topcities.com/error.gif
help me
thanks
bye
|
|
|
|
 |
|
 |
i don't know this is weird..
try recompiling the source in your VS and see what happends
|
|
|
|
 |
|
|
 |
|
 |
i cannot download the source code
can you send it to the following mail bnaya@wisemobility.com ?
Bnaya Eshet
.NET Expert and
Chief Architect at
Wise Mobility
|
|
|
|
 |
|
|
 |
|
 |
Hi, it's a good control. I liked the "snake" one
To improve it, you should add the line
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
in the OnPaint() method, in order to smooth the edges (the teeth like borders).
You have several values in the SmoothingMode enumeration, where "HighQuality" is the most powerfull (I think)...
See you
Matías
(from Uruguay)
|
|
|
|
 |
|
 |
Hi
thanks for the commet i appriciate it.
i added the smooth mode the fixed version is on the way
|
|
|
|
 |