Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET General

Post new topic   Reply to topic
Refreshing a form
View previous topic :: View next topic  
Author Message
TheMaskedPencil
Newbie


Joined: 15 Mar 2005
Posts: 4
Location: BC Canada

PostPosted: Jul 27th, 2005 11:00 PM    Post subject: Refreshing a form Reply with quote

Ok, I have been searching for the answer to this one. How do I get a form to refresh? I have tried Form1.Refresh() and Form1.Update(). The whole form and everything on it needs to refresh. I have looked on Google, I have search three different forums. The person who solves this will be a legend!

Thanks

The Masked Pencil
_________________
Never underestimate the power of the mentally restricted.
Back to top
View user's profile Send private message Visit poster's website
jmcilhinney
Freshman


Joined: 06 Jul 2005
Posts: 25
Location: Sydney, Australia

PostPosted: Aug 2nd, 2005 02:38 AM    Post subject: Reply with quote

You just call Me.Refresh
Back to top
View user's profile Send private message
TheMaskedPencil
Newbie


Joined: 15 Mar 2005
Posts: 4
Location: BC Canada

PostPosted: Aug 2nd, 2005 01:04 PM    Post subject: Reply with quote

Nope doesn't work. I just want the form to reload so that the Load action is fired off again, but that doesn't do it.
_________________
Never underestimate the power of the mentally restricted.
Back to top
View user's profile Send private message Visit poster's website
jmcilhinney
Freshman


Joined: 06 Jul 2005
Posts: 25
Location: Sydney, Australia

PostPosted: Aug 2nd, 2005 06:06 PM    Post subject: Reply with quote

There is a difference between refreshing a form, which means redrawing it, and reloading its data. The Load event is raised only once on each form. If you want to raise that event again you would need to close the current form and create a new instance. Why don't you take the code out of your Load event handler and put it in its own method. Then you can call that method from the Load event handler and any other time you need it. That's what methods are for.
Back to top
View user's profile Send private message
TheMaskedPencil
Newbie


Joined: 15 Mar 2005
Posts: 4
Location: BC Canada

PostPosted: Apr 22nd, 2006 11:09 PM    Post subject: Reply with quote

Well it has been a while but I figured out the problem. Rather than put the code that works directly under the forms Load area, just put the code in a function that is called when the form is loaded. It works for form loads, reloading a listbox that pulls from a database, and other odd problems. Try and see!
_________________
Never underestimate the power of the mentally restricted.
Back to top
View user's profile Send private message Visit poster's website
jmcilhinney
Freshman


Joined: 06 Jul 2005
Posts: 25
Location: Sydney, Australia

PostPosted: Apr 23rd, 2006 05:40 AM    Post subject: Reply with quote

That's exactly what I told you to do six months ago. Did you read my post?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic