|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
...and it's really written: txtSupportingForce.Text
|
|
#5
|
||||
|
||||
|
I'll need to look at some code to know.. .but it sounds like the variables are not being reinitialized.
|
|
#6
|
||||
|
||||
|
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.
|
|
#7
|
|||
|
|||
|
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! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > How to refresh/update a textbox? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|