-
Apr 3rd, 2004, 09:29 AM
#1
Thread Starter
Lively Member
-
Apr 3rd, 2004, 09:33 AM
#2
Not NoteMe
How have you made the web browser, what control are you using?
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts.
-
Apr 3rd, 2004, 09:37 AM
#3
Thread Starter
Lively Member
i just got the instructions from here, im not too sure about the vb terms. im sorry im making you goto a url
http://www.voxcommunications.com/sky/vb_webbrowser.htm
-
Apr 3rd, 2004, 09:40 AM
#4
Not NoteMe
I'm not at a computer with VB at the moment so i havn't tested this, but try putting this code in your forms Load event:
WebBrowser1.Navigate ("www.MyDefaultPage.com")
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts.
-
Apr 3rd, 2004, 09:50 AM
#5
Thread Starter
Lively Member
Thank you so much, SLH!
I tryed that code on all the wrong places, but did not think to do it on the form it self
:P
thanks again
-
Apr 3rd, 2004, 10:31 AM
#6
Thread Starter
Lively Member
one more question.. . is there a way to make a timer load a url from the browser?
-
Apr 3rd, 2004, 10:52 AM
#7
Frenzied Member
Add the URL to a Timer control
-
Apr 3rd, 2004, 11:21 AM
#8
Member
Thanks for the link, always like extra tutorials on how to do stuff
Good programming site:
*http://www.planet-source-code.com
Our CS Clan Page:
*http://h2p.inter-gamer.com/index.html
-
Apr 3rd, 2004, 02:31 PM
#9
Thread Starter
Lively Member
Hi, Insane_Magician, thats just a site from school
------------------------
Hi BrianS,
how do i add a url to a time controler?
im rather new at vb.
or does anyone else know how to?
-
Apr 3rd, 2004, 03:18 PM
#10
Not NoteMe
I'm not too sure what you want to do.
Do you want to load a specific web page after a given time, say every 5 minutes?
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts.
-
Apr 3rd, 2004, 03:44 PM
#11
Thread Starter
Lively Member
thats correct
-
Apr 3rd, 2004, 03:49 PM
#12
Not NoteMe
Add a timer control to your form (from the control toolbox), give it an appropriate interval (in seconds), the put the code i gave above into the timer's "Timer" event.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts.
-
Apr 3rd, 2004, 04:06 PM
#13
Actually, it's in milliseconds (thousandths of a second) . Remember, though, that the maximum interval is 65535 milliseconds (1.09225 minutes). If you want the interval to be over that, you'll need to use some tricks. Otherwise, the timer is fine as it is.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Apr 3rd, 2004, 04:52 PM
#14
Not NoteMe
Oops!!
If you do need an interval longer than that take a look at the SetTimer API, or have a counter variable in a timer with an interval of a minute.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts.
-
Apr 4th, 2004, 04:59 AM
#15
Thread Starter
Lively Member
i just need it to be 5 mins, but what do i do from here?
---------------------------------------------------------
Private Sub Timer1_Timer()
WebBrowser1.Navigate ("www.MyDefaultPage.com")
End Sub
-
Apr 4th, 2004, 06:29 AM
#16
Fanatic Member
You could set X=0 then have the timer go for 1000 and every time make x = x + 1 and when it gets to 5 load the page.
C#.net, VB, C++, Java, VS 2005/2008
Dont' forget to rate posts that are helpful to you.
-
Apr 4th, 2004, 01:37 PM
#17
Did you mean this:
VB Code:
Private Sub Form_Load()
WebBrowser1.Navigate ("http://google.com")
Timer1.Interval = 10000 '2 second
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Static iCounter As Integer
iCounter = iCounter + 1
If iCounter = 6 Then
frmBrowser.Show
WebBrowser1.Navigate ("http://yahoo.com")
iCounter = 0 'With your other code and this, every minute the navigate will fire
'With this line commented out, it will only happen once
End If
End Sub
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Apr 4th, 2004, 09:01 PM
#18
Really? It works fine for me. Could you post your project?
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Apr 4th, 2004, 09:04 PM
#19
Thread Starter
Lively Member
oops im sorry it does load, did not know it takes a min.
i thought it loads every 2 seconds.
but the problem is yahoo.com is still refreshing and not stoping
is there something i did wrong?
Code:
Private Sub Form_Load()
WebBrowser1.Navigate ("http://google.com")
Timer1.Interval = 10000 '2 second
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Static iCounter As Integer
iCounter = iCounter + 1
If iCounter = 6 Then
frmBrowser.Show
WebBrowser1.Navigate ("http://yahoo.com")
iCounter = 0 'With your other code and this, every minute the navigate will fire
'With this line commented out, it will only happen once
End If
End Sub
Julie Luvs
-
Apr 4th, 2004, 09:07 PM
#20
Comment out the line iCounter = 0 to make it only go to Yahoo once (after 1 minute). The interval multiplied by the control expression's constant in that if (6) is how long it will wait. In this case, it's 10,000 milliseconds times 6 = 60,000 milliseconds = 60 seconds = 1 minute. One other thing you might want to do if it only loads once is to disable the timer after you're done with it.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Apr 4th, 2004, 09:17 PM
#21
Thread Starter
Lively Member
im not too sure how to do this. may you please give me an example on how to stop timer?
Julie Luvs
-
Apr 4th, 2004, 09:24 PM
#22
On how to make it only navigate to Yahoo 1 time after 1 minute:
VB Code:
Private Sub Form_Load()
WebBrowser1.Navigate ("http://google.com")
Timer1.Interval = 10000 '2 second
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Static iCounter As Integer
iCounter = iCounter + 1
If iCounter = 6 Then
frmBrowser.Show
WebBrowser1.Navigate ("http://yahoo.com")
Timer1.Enabled = False
End If
End Sub
I hope I've answered what you asked. If not, just elaborate and I'll do it again
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Apr 4th, 2004, 09:31 PM
#23
Thread Starter
Lively Member
it works!!
Thank you so much, you were a great help!
Julie Luvs
-
Apr 4th, 2004, 09:36 PM
#24
Thread Starter
Lively Member
ok now i got another question, how can i make it load a third URL?
Julie Luvs
-
Apr 4th, 2004, 09:39 PM
#25
Something like.....
VB Code:
Private Sub Form_Load()
WebBrowser1.Navigate ("http://google.com")
Timer1.Interval = 10000 '2 second
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Static iCounter As Integer
iCounter = iCounter + 1
If iCounter = 6 Then
frmBrowser.Show
WebBrowser1.Navigate ("http://yahoo.com")
End If
If iCounter = 12 Then
frmBrowser.Show
WebBrowser1.Navigate ("http://cnn.com")
Timer1.Enabled = False
End If
End Sub
This'll originally go to Google, then, after 1 minute, Yahoo, and then, after another minute, CNN.com.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Apr 4th, 2004, 09:50 PM
#26
Thread Starter
Lively Member
how many seconds is:
Timer1.Interval = 10000
Julie Luvs
-
Apr 4th, 2004, 09:52 PM
#27
10.
The Interval property is in milliseconds which are thousandths of a second. Therefore, 1000 ms (abbreviation for milliseconds) = 1 second. 10 seconds = 10,000 ms.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Apr 4th, 2004, 09:57 PM
#28
Thread Starter
Lively Member
ahhh i get it now, i was so confused before
lol
Julie Luvs
-
Apr 4th, 2004, 10:05 PM
#29
Thread Starter
Lively Member
my math is really bad, please help
360000 ms = 6 min
?
Julie Luvs
-
Apr 4th, 2004, 10:07 PM
#30
Yes. Doing it in steps: 6 minutes = 6*60 seconds = 360 seconds. 360 seconds = 360 * 1000 ms = 360000.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Apr 4th, 2004, 10:16 PM
#31
Thread Starter
Lively Member
is there a way i can load up a .txt file of URLs
then after every 6 mins it changes URLs?
if its too much to type out for examples, can you tell me what keyword i need to look up or what is the command name called?
thanks
Last edited by Julie_Luvs; Apr 4th, 2004 at 10:20 PM.
Julie Luvs
-
Apr 4th, 2004, 11:26 PM
#32
Thread Starter
Lively Member
maximum interval is 65535 milliseconds (1.09225 minutes)
what can i use if i want the timer to be 6 mins long?
Julie Luvs
-
Apr 5th, 2004, 02:42 AM
#33
Hyperactive Member
VB Code:
'create a Timer on your form and set Interval = 1000 (1 second or whatever)
Private Sub Timer1_Timer()
Static intCounter As Integer
intCounter = intCounter + 1
If intCounter = 360000 Then '6minutes as passed
WrbBrowser.Navigate "www.google.com"
intCounter = 0
End If
End Sub
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped!
-
Apr 5th, 2004, 05:22 AM
#34
Thread Starter
Lively Member
i have no idea what i am doing.. . can you check what is wrong?
i been up all night trying to get this to work
Code:
Private Sub Form_Load()
Timer1.Interval = 1000 '1 sec
Timer1.Enabled = True
End Sub
'create a Timer on your form and set Interval = 1000 (1 second or whatever)
Private Sub Timer1_Timer()
Static intCounter As Integer
intCounter = intCounter + 1
If intCounter = 1000 Then '6minutes as passed
WebBrowser.Navigate ("www.google.com")
intCounter = 0
End If
End Sub
Julie Luvs
-
Apr 5th, 2004, 07:05 AM
#35
Well, that won't work because Integers can only hold a maximum of 32767.
I think you are better off using a string (what is the maximum for a Long?)
VB Code:
Private Sub Form_Load()
Timer1.Interval = 1000 '1 sec
Timer1.Enabled = True
End Sub
'create a Timer on your form and set Interval = 1000 (1 second or whatever)
Private Sub Timer1_Timer()
Static strCounter As String
Dim add As String
add = "1"
strCounter = strCounter + add
If strCounter ="360000" Then '6minutes as passed
WebBrowser.Navigate ("www.google.com")
intCounter = 0
End If
End Sub
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 5th, 2004, 07:15 AM
#36
Thread Starter
Lively Member
im kind of slow on this, give me a few and ill let you know how it works out for me
Julie Luvs
-
Apr 5th, 2004, 07:19 AM
#37
Thread Starter
Lively Member
i tryed the code provied, but it failed to load the webpage.
any idea what i maybe doing wrong?
Julie Luvs
-
Apr 5th, 2004, 07:32 AM
#38
Thread Starter
Lively Member
im still not able to get it to work.
im sorry, i know im starting to get anoying.
Julie Luvs
-
Apr 5th, 2004, 07:32 AM
#39
Change strCounter (or intCounter) to Currency.
VB Code:
Dim strCounter As Currency
Private Sub Form_Load()
Timer1.Interval = 1000 '1 sec
Timer1.Enabled = True
End Sub
'create a Timer on your form and set Interval = 1000 (1 second or whatever)
Private Sub Timer1_Timer()
hAdd strCounter, "1000"
MsgBox strCounter
If strCounter = "360000" Then '6minutes as passed
WebBrowser1.Navigate2 "www.google.com"
strCounter = "0"
End If
End Sub
Sub hAdd(a As Variant, b As Variant)
strCounter = a + b
End Sub
I have to sleep now, so thats the best I can come up with.
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 5th, 2004, 07:49 AM
#40
Thread Starter
Lively Member
Thank you for your time, sleep well.
-------------------
does anyone know where i should edit if i wanted to make it 6 mins?
hAdd strCounter, "1000" <---here?
MsgBox strCounter
If strCounter = "5000" Then '6minutes as passed <----or here?
Julie Luvs
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|