Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 17th, 2003, 11:18 AM
Knappe Knappe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Knappe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
How to refresh/update a textbox?

One more problem.
On the first form I have coded some arithmetical operations. When the operations are done you can open the results form with a cmdButton. You can go back and change some inputvalues on the first form and make new arithmetical operations, but when you open the results form again, the textboxes haven't been updated.

Is there some code to write in the form_load function to get the textboxes updated?

Reply With Quote
  #2  
Old November 17th, 2003, 11:41 AM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,176 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 42 m 4 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
This may be a dumb question, but you have made sure that after you perform your operations, that you are setting the textbox text property = the value of your calculation, right? If so, then there is a refresh method for text boxes... it's just

Code:
txtYourTextBox.text
__________________
Fisherman

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein

Reply With Quote
  #3  
Old November 17th, 2003, 12:00 PM
Knappe Knappe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Knappe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
In the main form the results are stored in different public variables. In the results form the textboxes are set like this:

txtSupportingForce.txt = varSF

It works like it should the first time but when I make new calculations the textboxes have the same values as the first time.

Reply With Quote
  #4  
Old November 17th, 2003, 12:01 PM
Knappe Knappe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Knappe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
...and it's really written: txtSupportingForce.Text

Reply With Quote
  #5  
Old November 17th, 2003, 02:03 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,176 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 42 m 4 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
I'll need to look at some code to know.. .but it sounds like the variables are not being reinitialized.

Reply With Quote
  #6  
Old November 19th, 2003, 05:14 AM
sir_drinxalot's Avatar
sir_drinxalot sir_drinxalot is offline
Known to taste like chicken
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: In front of my computer
Posts: 228 sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 13 h 59 m 40 sec
Reputation Power: 19
Send a message via MSN to sir_drinxalot
Facebook
in your declarations you could create a function called refresher or a name you will recognise, and put all of your txtSupportingForce.text = varSF etc in there, then in the Form_Load() you can call refresher and it should update you text boxes....that how i usually do it and i havnt had any major probs as such.

Reply With Quote
  #7  
Old November 19th, 2003, 05:39 AM
Knappe Knappe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Knappe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I actually solved the problem by changing the code in the button that closes the results form. I just changed frmResults.Hide to Unload Me.

Thanks anyway!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > How to refresh/update a textbox?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway