New Posts  All Forums:Forum Nav:

c# Progress Bar Error !?!?

post #1 of 7
Thread Starter 
Hello there guys, The progress fine works partialy, but the debuger finds an error...
This error never happened when I was using c# 2008 express...
now with Visual Studio 2010 I get this error...

This is the error:

progressBar1.Value = (int)e.CurrentProgress;
Value of '-1' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.
Parameter name: Value

This is the code:

Code:

private void webBrowser1_Progress(object sender, WebBrowserProgressChangedEventArgs e)
       

         progressBar1.Maximum = (int)e.MaximumProgress;
         progressBar1.Value = (int)e.CurrentProgress;
Also I tried this:

Code:


progressBar1.Maximum = Convert.Toint32(e.MaximumProgress);

progressBar1.Value = Convert.Toint32(e.CurrentProgress);
ENTIRE CODE
Code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;



namespace SelfUpdate
{
    public partial class browser : Form
    {
       
        

        public browser()
        {
            InitializeComponent();
        }

        private void webBrowser1_Progress(object sender, WebBrowserProgressChangedEventArgs e)
        {

            if (e.CurrentProgress < 0)
            {
                
            }
            else
            {
                progressBar1.Maximum = (int)e.MaximumProgress;
                progressBar1.Value = (int)e.CurrentProgress;
            }
        }



        private void BTNback_Click(object sender, EventArgs e)
        {
            webBrowser1.GoBack();
        }

        private void BTNfw_Click(object sender, EventArgs e)
        {
            webBrowser1.GoForward();
        }

        private void BTNstop_Click(object sender, EventArgs e)
        {
            webBrowser1.Stop();
        }

        private void BTNrefresh_Click(object sender, EventArgs e)
        {
            webBrowser1.Refresh();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            webBrowser1.Navigate(textBox1.Text);
        }

        private void textBox1__KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {                
                Navigate(textBox1.Text);
            }
        }

        // Navigates to the given URL if it is valid.
        private void Navigate(String address)
        {
            if (String.IsNullOrEmpty(address)) return;
            if (address.Equals("about:blank")) return;
            if (!address.StartsWith("http://") &&
                !address.StartsWith("https://"))
            {
                address = "http://" + address;
            }
           

           
            
            try
            {
                webBrowser1.Navigate(new Uri(address));
            }
            catch (System.UriFormatException)
            {
                return;
            }
        }


        private void autocomplete(String address)
        {
            
            if (!address.EndsWith(".com"))
            {
                address = "http://" + address +".com";
            }




            try
            {
                webBrowser1.Navigate(new Uri(address));
            }
            catch (System.UriFormatException)
            {
                return;
            }
        }






        // Updates the URL in TextBoxAddress upon navigation.
        private void webBrowser1_Navigated(object sender,
            WebBrowserNavigatedEventArgs e)
        {
            textBox1.Text = webBrowser1.Url.ToString();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        

        
        
        

    }


}
Also, the

Code:

 if (e.CurrentProgress < 0)
was never there before, but seems like it didn't solve my problem.
Any ideas??
Thank you !
Super Athlon
(13 items)
 
Ultra Intel
(14 items)
 
 
CPUMotherboardGraphicsRAM
Athlon 64 FX-62 Windsor GIGABYTE GA-M59SLI-S5 AM2 ATI RADEON HD 5770 SUPER TALENT 4GB (4 x 1GB) 240-Pin DDR2 800 
Hard DriveOSMonitorKeyboard
SCSI 15000 RPM OS + 250GB 7200 SATA II Linux 9.10 Karmic Kaola EMPTY ATM Saitek Ultra 
PowerCaseMouseMouse Pad
750W cheap one Custom Made DYNEX DELL 
CPUMotherboardGraphicsRAM
Intel I7 2600K S 1155 046MHW 1 x GTX 980 8GB DDR3 Cas9 1866Mhz 
Hard DriveHard DriveCoolingOS
2x Vertex 3 Raid 0 2x TB Raid 0 Hitachi Storage Hydro H70 7 Ultimage + Linux Gutsy 7.10 
MonitorKeyboardPowerCase
VX2268WM Saitek Ultra 875 WATTS Alien Aurora R3 Modded 
MouseMouse Pad
G9X Xtrac RIPPER 
CPUMotherboardGraphicsRAM
PHENOM II X4 955 4.0 GHZ 790FX-GD70 GTX 480 8192 
Hard DriveOSMonitorKeyboard
2 SSD Vertex 2 @ Raid 0. 2 250HDD's @ Raid 0 1 350 Linux 7.10 Gutsy + Windows 7 Ultimate 64 Samsung 21.5 Saitek Ultra 
PowerCaseMouseMouse Pad
Thermaltake Black Widow W0319RU 850W ATX 12V v2.3 Thermaltake Armor A90 Black Steel DYNEX DELL 
  hide details  
Reply
Super Athlon
(13 items)
 
Ultra Intel
(14 items)
 
 
CPUMotherboardGraphicsRAM
Athlon 64 FX-62 Windsor GIGABYTE GA-M59SLI-S5 AM2 ATI RADEON HD 5770 SUPER TALENT 4GB (4 x 1GB) 240-Pin DDR2 800 
Hard DriveOSMonitorKeyboard
SCSI 15000 RPM OS + 250GB 7200 SATA II Linux 9.10 Karmic Kaola EMPTY ATM Saitek Ultra 
PowerCaseMouseMouse Pad
750W cheap one Custom Made DYNEX DELL 
CPUMotherboardGraphicsRAM
Intel I7 2600K S 1155 046MHW 1 x GTX 980 8GB DDR3 Cas9 1866Mhz 
Hard DriveHard DriveCoolingOS
2x Vertex 3 Raid 0 2x TB Raid 0 Hitachi Storage Hydro H70 7 Ultimage + Linux Gutsy 7.10 
MonitorKeyboardPowerCase
VX2268WM Saitek Ultra 875 WATTS Alien Aurora R3 Modded 
MouseMouse Pad
G9X Xtrac RIPPER 
CPUMotherboardGraphicsRAM
PHENOM II X4 955 4.0 GHZ 790FX-GD70 GTX 480 8192 
Hard DriveOSMonitorKeyboard
2 SSD Vertex 2 @ Raid 0. 2 250HDD's @ Raid 0 1 350 Linux 7.10 Gutsy + Windows 7 Ultimate 64 Samsung 21.5 Saitek Ultra 
PowerCaseMouseMouse Pad
Thermaltake Black Widow W0319RU 850W ATX 12V v2.3 Thermaltake Armor A90 Black Steel DYNEX DELL 
  hide details  
Reply
post #2 of 7
Are you sure it worked before? OK. Let’s try this. Put the code inside webBrowser1_ ProgressChanged event instead of webBrowser1_Progress event. Also, you may need to detect value before decide what to do. For instance, if e.MaximumProgress > 0 And e.CurrentProgress > 0 then display the value, but if e.MaximumProgress = 0 And e.CurrentProgress = 0 then reset the progress bard value to 0. Otherwise, do nothing.
post #3 of 7
Thread Starter 
Quote:
Originally Posted by linskingdom View Post
Are you sure it worked before? OK. Let’s try this. Put the code inside webBrowser1_ ProgressChanged event instead of webBrowser1_Progress event. Also, you may need to detect value before decide what to do. For instance, if e.MaximumProgress > 0 And e.CurrentProgress > 0 then display the value, but if e.MaximumProgress = 0 And e.CurrentProgress = 0 then reset the progress bard value to 0. Otherwise, do nothing.
Thanks bro... I am at work right now, I will try that advice as soon as I have a chance, Also, I did put a statement If else about the value being less or equal to 0, and even <= -1 ... I tried soooo much different things but that progress bar is giving me funny errors in the debugger.

I had many progress bars work before, but to calculate different things, like file transfer's etc... Never worked with a progress bar inside of a browser before..

Thanks buddy, I will let you know the results one I try it.

Thanks again.



-----EDIT -----




It seems like everything is where it is supposed to be...
I rechecked the whole code, it seems to be straight...

Also, the program compiles fine, there are 0 build errors..
it's only when it is debugging... see?





Now for some reason, the error does not say value of -1 ... but maybe that's because I used
int instead of Convert.Toint32





Also, It is inside the progressChanged ... I called it progress instead of progresschanged for less typing but it is the same...

Code:
this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.webBrowser1.Location = new System.Drawing.Point(0, 0);
            this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
            this.webBrowser1.Name = "webBrowser1";
            this.webBrowser1.Size = new System.Drawing.Size(1008, 678);
            this.webBrowser1.TabIndex = 0;
            this.webBrowser1.Url = new System.Uri("http://www.overclock.net/application-programming/895778-c-generator-open-source.h" +
                    "tml#post11745165", System.UriKind.Absolute);
            this.webBrowser1.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.webBrowser1_Navigated);
            this.webBrowser1.ProgressChanged += new System.Windows.Forms.WebBrowserProgressChangedEventHandler(this.webBrowser1_Progress);

Edited by thiagocosta85 - 12/28/10 at 9:05pm
Super Athlon
(13 items)
 
Ultra Intel
(14 items)
 
 
CPUMotherboardGraphicsRAM
Athlon 64 FX-62 Windsor GIGABYTE GA-M59SLI-S5 AM2 ATI RADEON HD 5770 SUPER TALENT 4GB (4 x 1GB) 240-Pin DDR2 800 
Hard DriveOSMonitorKeyboard
SCSI 15000 RPM OS + 250GB 7200 SATA II Linux 9.10 Karmic Kaola EMPTY ATM Saitek Ultra 
PowerCaseMouseMouse Pad
750W cheap one Custom Made DYNEX DELL 
CPUMotherboardGraphicsRAM
Intel I7 2600K S 1155 046MHW 1 x GTX 980 8GB DDR3 Cas9 1866Mhz 
Hard DriveHard DriveCoolingOS
2x Vertex 3 Raid 0 2x TB Raid 0 Hitachi Storage Hydro H70 7 Ultimage + Linux Gutsy 7.10 
MonitorKeyboardPowerCase
VX2268WM Saitek Ultra 875 WATTS Alien Aurora R3 Modded 
MouseMouse Pad
G9X Xtrac RIPPER 
CPUMotherboardGraphicsRAM
PHENOM II X4 955 4.0 GHZ 790FX-GD70 GTX 480 8192 
Hard DriveOSMonitorKeyboard
2 SSD Vertex 2 @ Raid 0. 2 250HDD's @ Raid 0 1 350 Linux 7.10 Gutsy + Windows 7 Ultimate 64 Samsung 21.5 Saitek Ultra 
PowerCaseMouseMouse Pad
Thermaltake Black Widow W0319RU 850W ATX 12V v2.3 Thermaltake Armor A90 Black Steel DYNEX DELL 
  hide details  
Reply
Super Athlon
(13 items)
 
Ultra Intel
(14 items)
 
 
CPUMotherboardGraphicsRAM
Athlon 64 FX-62 Windsor GIGABYTE GA-M59SLI-S5 AM2 ATI RADEON HD 5770 SUPER TALENT 4GB (4 x 1GB) 240-Pin DDR2 800 
Hard DriveOSMonitorKeyboard
SCSI 15000 RPM OS + 250GB 7200 SATA II Linux 9.10 Karmic Kaola EMPTY ATM Saitek Ultra 
PowerCaseMouseMouse Pad
750W cheap one Custom Made DYNEX DELL 
CPUMotherboardGraphicsRAM
Intel I7 2600K S 1155 046MHW 1 x GTX 980 8GB DDR3 Cas9 1866Mhz 
Hard DriveHard DriveCoolingOS
2x Vertex 3 Raid 0 2x TB Raid 0 Hitachi Storage Hydro H70 7 Ultimage + Linux Gutsy 7.10 
MonitorKeyboardPowerCase
VX2268WM Saitek Ultra 875 WATTS Alien Aurora R3 Modded 
MouseMouse Pad
G9X Xtrac RIPPER 
CPUMotherboardGraphicsRAM
PHENOM II X4 955 4.0 GHZ 790FX-GD70 GTX 480 8192 
Hard DriveOSMonitorKeyboard
2 SSD Vertex 2 @ Raid 0. 2 250HDD's @ Raid 0 1 350 Linux 7.10 Gutsy + Windows 7 Ultimate 64 Samsung 21.5 Saitek Ultra 
PowerCaseMouseMouse Pad
Thermaltake Black Widow W0319RU 850W ATX 12V v2.3 Thermaltake Armor A90 Black Steel DYNEX DELL 
  hide details  
Reply
post #4 of 7
In earlier versions of the ProgressBar control, such as the version that is provided with the Microsoft Windows Common Controls ActiveX control, you can view the progress in two different views. To control these views, you use the Scrolling property, which includes standard and smooth settings. Smooth scrolling produces a solid block of color that represents the progress, and standard scrolling appears segmented and is made up of a series of small blocks or rectangles.

The ProgressBar control that is included with Microsoft Visual C# supports only the standard setting.

The sample code in this article illustrates how to create a control that supports the following properties:
Minimum. This property obtains or sets the lower value for the range of valid values for progress. The default value of this property is zero (0); you cannot set this property to a negative value.
Maximum. This property obtains or sets the upper value for the range of valid values for progress. The default value of this property is 100.
Value. This property obtains or sets the current level of progress. The value must be in the range that the Minimum and the Maximum properties define.
ProgressBarColor. This property obtains or sets the color of the progress bar.
Back to the top
Create a custom ProgressBar control
Follow these steps to create a new Windows Control Library project in Visual C#:
Start Microsoft Visual Studio.
On the File menu, point to New, and then click Project.
In the New Project dialog box, click Visual C# under Project Types, and then click Windows Forms Control Library under Templates.

Note In Visual Studio .NET 2003, click Visual C# Projects instead of Visual C#.
In the Name box, type SmoothProgressBar, and then click OK.
In Project Explorer, rename the default class module from UserControl1.cs to SmoothProgressBar.cs.
In the Properties window for the UserControl object, change the Name property from UserControl1 to SmoothProgressBar.
At this point, you typically inherit from the class of that control and then add the additional functionality to extend an existing control. However, the ProgressBar class is sealed and cannot be inherited. Therefore, you must build the control from the beginning.

Add the following code to the SmoothProgressBar.cs file, in the class that is derived from UserControl.

Note In Visual Studio .NET 2003, add the code to the class module of the UserControl derived class, just after the “Windows Form Designer generated code” section.
int min = 0;// Minimum value for progress range
int max = 100;// Maximum value for progress range
int val = 0;// Current progress
Color BarColor = Color.Blue;// Color of progress meter

protected override void OnResize(EventArgs e)
{
// Invalidate the control to get a repaint.
this.Invalidate();
}

protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
SolidBrush brush = new SolidBrush(BarColor);
float percent = (float)(val - min) / (float)(max - min);
Rectangle rect = this.ClientRectangle;

// Calculate area for drawing the progress.
rect.Width = (int)((float)rect.Width * percent);

// Draw the progress meter.
g.FillRectangle(brush, rect);

// Draw a three-dimensional border around the control.
Draw3DBorder(g);

// Clean up.
brush.Dispose();
g.Dispose();
}

public int Minimum
{
get
{
return min;
}

set
{
// Prevent a negative value.
if (value < 0)
{
min = 0;
}

// Make sure that the minimum value is never set higher than the maximum value.
if (value > max)
{
min = value;
min = value;
}

// Ensure value is still in range
if (val < min)
{
val = min;
}

// Invalidate the control to get a repaint.
this.Invalidate();
}
}

public int Maximum
{
get
{
return max;
}

set
{
// Make sure that the maximum value is never set lower than the minimum value.
if (value < min)
{
min = value;
}

max = value;

// Make sure that value is still in range.
if (val > max)
{
val = max;
}

// Invalidate the control to get a repaint.
this.Invalidate();
}
}

public int Value
{
get
{
return val;
}

set
{
int oldValue = val;

// Make sure that the value does not stray outside the valid range.
if (value < min)
{
val = min;
}
else if (value > max)
{
val = max;
}
else
{
val = value;
}

// Invalidate only the changed area.
float percent;

Rectangle newValueRect = this.ClientRectangle;
Rectangle oldValueRect = this.ClientRectangle;

// Use a new value to calculate the rectangle for progress.
percent = (float)(val - min) / (float)(max - min);
newValueRect.Width = (int)((float)newValueRect.Width * percent);

// Use an old value to calculate the rectangle for progress.
percent = (float)(oldValue - min) / (float)(max - min);
oldValueRect.Width = (int)((float)oldValueRect.Width * percent);

Rectangle updateRect = new Rectangle();

// Find only the part of the screen that must be updated.
if (newValueRect.Width > oldValueRect.Width)
{
updateRect.X = oldValueRect.Size.Width;
updateRect.Width = newValueRect.Width - oldValueRect.Width;
}
else
{
updateRect.X = newValueRect.Size.Width;
updateRect.Width = oldValueRect.Width - newValueRect.Width;
}

updateRect.Height = this.Height;

// Invalidate the intersection region only.
this.Invalidate(updateRect);
}
}

public Color ProgressBarColor
{
get
{
return BarColor;
}

set
{
BarColor = value;

// Invalidate the control to get a repaint.
this.Invalidate();
}
}

private void Draw3DBorder(Graphics g)
{
int PenWidth = (int)Pens.White.Width;

g.DrawLine(Pens.DarkGray,
new Point(this.ClientRectangle.Left, this.ClientRectangle.Top),
new Point(this.ClientRectangle.Width - PenWidth, this.ClientRectangle.Top));
g.DrawLine(Pens.DarkGray,
new Point(this.ClientRectangle.Left, this.ClientRectangle.Top),
new Point(this.ClientRectangle.Left, this.ClientRectangle.Height - PenWidth));
g.DrawLine(Pens.White,
new Point(this.ClientRectangle.Left, this.ClientRectangle.Height - PenWidth),
new Point(this.ClientRectangle.Width - PenWidth, this.ClientRectangle.Height - PenWidth));
g.DrawLine(Pens.White,
new Point(this.ClientRectangle.Width - PenWidth, this.ClientRectangle.Top),
new Point(this.ClientRectangle.Width - PenWidth, this.ClientRectangle.Height - PenWidth));
}

On the Build menu, click Build Solution to compile the project.
Back to the top
Create a sample client application
On the File menu, point to New, and then click Project.
In the Add New Project dialog box, click Visual C# under Project Types, click Windows Forms Application under Templates, and then click OK.

Note In Visual Studio .NET 2003, click Visual C# Projects instead of Visual C#.
Follow these steps to add two instances of the SmoothProgressBar control to the form:
On the Tools menu, click Choose Toolbox Items.

Note In Visual Studio .NET 2003, click Customize Toolbox instead of Choose Toolbox Items.
Click the .NET Framework Components tab.
Click Browse, and then locate the SmoothProgressBar.dll file, which you created in the "Create a custom ProgressBar control" section.
Click OK. Notice that the SmoothProgressBar control is added to the toolbox.
Drag two instances of the SmoothProgressBar control from the toolbox to the default form of the Windows Application project.
Drag a Timer control from the toolbox to the form.
Add the following code to the Tick event of the Timer control:
if (this.smoothProgressBar1.Value > 0)
{
this.smoothProgressBar1.Value--;
this.smoothProgressBar2.Value++;
}
else
{
this.timer1.Enabled = false;
}

Drag a Button control from the toolbox to the form.
Add the following code to the Click event of the Button control:
this.smoothProgressBar1.Value = 100;
this.smoothProgressBar2.Value = 0;

this.timer1.Interval = 1;
this.timer1.Enabled = true;

On the Debug menu, click Start to run the sample project.
Click the button. Notice that the two progress indicators display the text "progress". One progress indicator displays the progress in an increasing manner, and the other progress indicator displays the progress in a decreasing or a countdown manner.
Khaos
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 @ 4.59ghz Asus P6T Gigabyte GTX 1080 48GB 6 x G.SKILL Ripjaws X 8GB DDR3 1866 
Hard DriveCoolingOSMonitor
28 x WD Blk 8TB Raid 6 on Areca 24 port SATA/SA... Xigmatek 1283EE 2016 Standard 3x 43" 4k 120hz 
KeyboardPowerCaseMouse
Ergodox Infinity 1.2b Dual 1200w P2 CM Stacker 810 Roccat Tyon 
Mouse PadAudio
48x16" deskmat SMSL AD18, Klipsch R-15M, xDuoo DAC, AKG K7XX 
  hide details  
Reply
Khaos
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 @ 4.59ghz Asus P6T Gigabyte GTX 1080 48GB 6 x G.SKILL Ripjaws X 8GB DDR3 1866 
Hard DriveCoolingOSMonitor
28 x WD Blk 8TB Raid 6 on Areca 24 port SATA/SA... Xigmatek 1283EE 2016 Standard 3x 43" 4k 120hz 
KeyboardPowerCaseMouse
Ergodox Infinity 1.2b Dual 1200w P2 CM Stacker 810 Roccat Tyon 
Mouse PadAudio
48x16" deskmat SMSL AD18, Klipsch R-15M, xDuoo DAC, AKG K7XX 
  hide details  
Reply
post #5 of 7
Thread Starter 
Thanks bro..

I will definitely try this in a couple of hours...
Vinoth Patel, was able to get the standard Progress Bar working some how.. I don't know what the heck he did...

I will try these settings with the standard progress bar, you think it will work?
well It worked with c# express older version...

Thanks a bunch man

Thank you 1000X
Super Athlon
(13 items)
 
Ultra Intel
(14 items)
 
 
CPUMotherboardGraphicsRAM
Athlon 64 FX-62 Windsor GIGABYTE GA-M59SLI-S5 AM2 ATI RADEON HD 5770 SUPER TALENT 4GB (4 x 1GB) 240-Pin DDR2 800 
Hard DriveOSMonitorKeyboard
SCSI 15000 RPM OS + 250GB 7200 SATA II Linux 9.10 Karmic Kaola EMPTY ATM Saitek Ultra 
PowerCaseMouseMouse Pad
750W cheap one Custom Made DYNEX DELL 
CPUMotherboardGraphicsRAM
Intel I7 2600K S 1155 046MHW 1 x GTX 980 8GB DDR3 Cas9 1866Mhz 
Hard DriveHard DriveCoolingOS
2x Vertex 3 Raid 0 2x TB Raid 0 Hitachi Storage Hydro H70 7 Ultimage + Linux Gutsy 7.10 
MonitorKeyboardPowerCase
VX2268WM Saitek Ultra 875 WATTS Alien Aurora R3 Modded 
MouseMouse Pad
G9X Xtrac RIPPER 
CPUMotherboardGraphicsRAM
PHENOM II X4 955 4.0 GHZ 790FX-GD70 GTX 480 8192 
Hard DriveOSMonitorKeyboard
2 SSD Vertex 2 @ Raid 0. 2 250HDD's @ Raid 0 1 350 Linux 7.10 Gutsy + Windows 7 Ultimate 64 Samsung 21.5 Saitek Ultra 
PowerCaseMouseMouse Pad
Thermaltake Black Widow W0319RU 850W ATX 12V v2.3 Thermaltake Armor A90 Black Steel DYNEX DELL 
  hide details  
Reply
Super Athlon
(13 items)
 
Ultra Intel
(14 items)
 
 
CPUMotherboardGraphicsRAM
Athlon 64 FX-62 Windsor GIGABYTE GA-M59SLI-S5 AM2 ATI RADEON HD 5770 SUPER TALENT 4GB (4 x 1GB) 240-Pin DDR2 800 
Hard DriveOSMonitorKeyboard
SCSI 15000 RPM OS + 250GB 7200 SATA II Linux 9.10 Karmic Kaola EMPTY ATM Saitek Ultra 
PowerCaseMouseMouse Pad
750W cheap one Custom Made DYNEX DELL 
CPUMotherboardGraphicsRAM
Intel I7 2600K S 1155 046MHW 1 x GTX 980 8GB DDR3 Cas9 1866Mhz 
Hard DriveHard DriveCoolingOS
2x Vertex 3 Raid 0 2x TB Raid 0 Hitachi Storage Hydro H70 7 Ultimage + Linux Gutsy 7.10 
MonitorKeyboardPowerCase
VX2268WM Saitek Ultra 875 WATTS Alien Aurora R3 Modded 
MouseMouse Pad
G9X Xtrac RIPPER 
CPUMotherboardGraphicsRAM
PHENOM II X4 955 4.0 GHZ 790FX-GD70 GTX 480 8192 
Hard DriveOSMonitorKeyboard
2 SSD Vertex 2 @ Raid 0. 2 250HDD's @ Raid 0 1 350 Linux 7.10 Gutsy + Windows 7 Ultimate 64 Samsung 21.5 Saitek Ultra 
PowerCaseMouseMouse Pad
Thermaltake Black Widow W0319RU 850W ATX 12V v2.3 Thermaltake Armor A90 Black Steel DYNEX DELL 
  hide details  
Reply
post #6 of 7
It isn’t a syntax error so compiler won’t capture it. Your case is bit wired because the value of e.CurrentProgress is greater than the value of e.MaximumProgress. So, what’s the value of e.MaximumProgress when e. CurrentProgress was ‘501800’? I don’t have IDE here so I can’t help you debug that. You can give a try on creating a customer control liked LiNERROR suggested to see how it works. I still believe the standard progress should be fine. Technically, 4.0 can coexist with previous 3.5, 3.0 and 2.0. I am pretty sure you use the correct version but just check the version to see if it is 4.0.0 but not 3.5.0 or 2.0.0.
post #7 of 7
Thread Starter 
Lol... I got it... !!!!!!

I can't believe I got stuck on this... lol...
Everything was ok, the max value, and all... but some how (I dont know why) I had to do this... the error no longer exists, and at the same time, the progress bar stays full when it's done...


Code:

 private void webBrowser1_Progress(object sender, WebBrowserProgressChangedEventArgs e)
        {

            if (e.CurrentProgress == 0 || e.CurrentProgress == 90000000)
                {
                    //progressBar1.Value = 90000000;
                    progressBar1.Value = 0;
                    

                    progressBar1.Value = (int)e.CurrentProgress;
                    progressBar1.Value = 90000000;
                    
                }
                
                else
                {

                    return;
                    
                }
Super Athlon
(13 items)
 
Ultra Intel
(14 items)
 
 
CPUMotherboardGraphicsRAM
Athlon 64 FX-62 Windsor GIGABYTE GA-M59SLI-S5 AM2 ATI RADEON HD 5770 SUPER TALENT 4GB (4 x 1GB) 240-Pin DDR2 800 
Hard DriveOSMonitorKeyboard
SCSI 15000 RPM OS + 250GB 7200 SATA II Linux 9.10 Karmic Kaola EMPTY ATM Saitek Ultra 
PowerCaseMouseMouse Pad
750W cheap one Custom Made DYNEX DELL 
CPUMotherboardGraphicsRAM
Intel I7 2600K S 1155 046MHW 1 x GTX 980 8GB DDR3 Cas9 1866Mhz 
Hard DriveHard DriveCoolingOS
2x Vertex 3 Raid 0 2x TB Raid 0 Hitachi Storage Hydro H70 7 Ultimage + Linux Gutsy 7.10 
MonitorKeyboardPowerCase
VX2268WM Saitek Ultra 875 WATTS Alien Aurora R3 Modded 
MouseMouse Pad
G9X Xtrac RIPPER 
CPUMotherboardGraphicsRAM
PHENOM II X4 955 4.0 GHZ 790FX-GD70 GTX 480 8192 
Hard DriveOSMonitorKeyboard
2 SSD Vertex 2 @ Raid 0. 2 250HDD's @ Raid 0 1 350 Linux 7.10 Gutsy + Windows 7 Ultimate 64 Samsung 21.5 Saitek Ultra 
PowerCaseMouseMouse Pad
Thermaltake Black Widow W0319RU 850W ATX 12V v2.3 Thermaltake Armor A90 Black Steel DYNEX DELL 
  hide details  
Reply
Super Athlon
(13 items)
 
Ultra Intel
(14 items)
 
 
CPUMotherboardGraphicsRAM
Athlon 64 FX-62 Windsor GIGABYTE GA-M59SLI-S5 AM2 ATI RADEON HD 5770 SUPER TALENT 4GB (4 x 1GB) 240-Pin DDR2 800 
Hard DriveOSMonitorKeyboard
SCSI 15000 RPM OS + 250GB 7200 SATA II Linux 9.10 Karmic Kaola EMPTY ATM Saitek Ultra 
PowerCaseMouseMouse Pad
750W cheap one Custom Made DYNEX DELL 
CPUMotherboardGraphicsRAM
Intel I7 2600K S 1155 046MHW 1 x GTX 980 8GB DDR3 Cas9 1866Mhz 
Hard DriveHard DriveCoolingOS
2x Vertex 3 Raid 0 2x TB Raid 0 Hitachi Storage Hydro H70 7 Ultimage + Linux Gutsy 7.10 
MonitorKeyboardPowerCase
VX2268WM Saitek Ultra 875 WATTS Alien Aurora R3 Modded 
MouseMouse Pad
G9X Xtrac RIPPER 
CPUMotherboardGraphicsRAM
PHENOM II X4 955 4.0 GHZ 790FX-GD70 GTX 480 8192 
Hard DriveOSMonitorKeyboard
2 SSD Vertex 2 @ Raid 0. 2 250HDD's @ Raid 0 1 350 Linux 7.10 Gutsy + Windows 7 Ultimate 64 Samsung 21.5 Saitek Ultra 
PowerCaseMouseMouse Pad
Thermaltake Black Widow W0319RU 850W ATX 12V v2.3 Thermaltake Armor A90 Black Steel DYNEX DELL 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming