Hello there guys !
I am having a bit of trouble.
This is the code:
private void webBrowser1_ProgressChanged(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; } } private void lblprogress_ChangeText(object sender, EventArgs e) { if (progressBar1.Value != 90000000) { LBLprogress.Text = "Loading"; } else { LBLprogress.Text = "Finished"; } }
|
That code seems not to be working...
What I am trying to do is:
If progressBar1's value, is not
90000000, change LBLprogress's text to Loading, Otherwise Finished..
What am I doing wrong ??
Thanks guys
should I replace EventArgs with something else? I tryed LabelEditHandler and it gave me a delegate error.
theLizardPosted Dec 29, 2010, 8:19 PM
in the Eneter key down event and the go button click eventthiago costaPosted Dec 29, 2010, 8:32 PM
private void button1_Click(object sender, EventArgs e)
{
LBLprogress.Text = "Loading";
webBrowser1.Navigate(textBox1.Text);
// This works PERFECT !!!!!!!!
}
But it did not work with the keydown event:
private void textBox1__KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
LBLprogress.Text = "Loading";
Navigate(textBox1.Text);
//This did not work :'( I don't understand.
}
}
This is not the first time I have issues with renaming labels... is it a visual studio 2010 bug? ... I don't understand :'(
------------------
----------------- EDIT
-----------------
I'm sorry.. Yes it did work !!!!!!!!!!!!!
IT DID WORK !!!!!!!!!!
Weird the first time it didn't now it did !!!!
THANKSSSS MAn !
thiago costaPosted Dec 29, 2010, 8:12 PM
It is in the Browser Form ...
The event will be called everytime the Enter key is pressed while in the url textbox, and also everytime we click on the GO button.
Everytime a new page loads.
But, I will to put the "loading" part of the code before the IF like you said :D
Thanks man
---EDIT---
Nope, I just put the code before the IF, and it didn't work...
theLizardPosted Dec 29, 2010, 8:01 PM
What you could do is put this
before thisthiago costaPosted Dec 29, 2010, 7:49 PM
Thanks a lot man..
I tried what you sujested, the results were:
The text changes from loading to finished...
But once it says finished for the first time, it never says Loading again !!!!!...
:'( ... Any Ideas?
Is there Any way to use event?
If not, it's fine, what ever works will be nice. =D
Thanks again bro.
theLizardPosted Dec 29, 2010, 7:35 PM