theLizardRank #1,079 · 1.8K reputationPosted Dec 29, 2010, 3:01 PM EST
0
yes there is but I don't know where to put the call to fire the event with the code you are showing.
What you could do is put this
Code
LBLprogress.Text = "Loading";
before this
C#
if (e.CurrentProgress == 0 || e.CurrentProgress == 90000000)
this way every time privatevoidwebBrowser1_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e) is called the label isset to "Loading"
edit: thinking about this it should have worked the way it was.
What calls the webBrowser1_ProgressChanged.
how many times will the event be called?
Edit: dothisin your if{...} LBLprogress.Text = e.CurrentProgress == 0? "Loading": LBLprogress.Text;
theLizardRank #1,079 · 1.8K reputationPosted Dec 29, 2010, 3:19 PM EST
theLizardRank #1,079 · 1.8K reputationPosted Dec 29, 2010, 2:35 PM EST
}
else
{
return;}
}
thiago costaRank #6,113 · 276 reputationPosted Dec 29, 2010, 2:49 PM EST
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.
theLizardRank #1,079 · 1.8K reputationPosted Dec 29, 2010, 3:01 PM EST
What you could do is put this
if (e.CurrentProgress == 0 || e.CurrentProgress == 90000000) this way every time private void webBrowser1_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e) is called the label is set to "Loading" edit: thinking about this it should have worked the way it was. What calls the webBrowser1_ProgressChanged. how many times will the event be called? Edit: do this in your if{...} LBLprogress.Text = e.CurrentProgress == 0? "Loading": LBLprogress.Text;thiago costaRank #6,113 · 276 reputationPosted Dec 29, 2010, 3:12 PM EST
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...
thiago costaRank #6,113 · 276 reputationPosted Dec 29, 2010, 3:32 PM EST
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 !