Page 1 of 1

Text Box Update

Posted: Fri Mar 24, 2017 7:28 pm
by franco
Having trouble updating text box value.
I am in a window with a grid and some text boxes
to update the grid and text boxes i have a function as follows. The grid emptys but the text boxes do not refresh to zero.
there must be something I am missing to update the text boxes values.
if I put a message box at the bottom, the text boxes refresh

function prpr3()
FORM_GRID_IN2.GRID_2.itemcount := 0
FORM_GRID_IN2.Text_6.Value := 0
FORM_GRID_IN2.Text_7.Value := 0
FORM_GRID_IN2.Text_8.Value := 0
FORM_GRID_IN2.Text_9.Value := 0
FORM_GRID_IN2.Text_10.Value := 0
FORM_GRID_IN2.Text_12.Value := 0
FORM_GRID_IN2.Text_13.Value := 0
FORM_GRID_IN2.Text_14.Value := 0
FORM_GRID_IN2.Text_15.Value := 0
FORM_GRID_IN2.Text_16.Value := 0
FORM_GRID_IN2.Text_17.Value := 0
FORM_GRID_IN2.Text_18.Value := ''
FORM_GRID_IN2.Text_19.Value := 0
FORM_GRID_IN2.Text_20.Value := 0
FORM_GRID_IN2.Text_21.Value := 0
FORM_GRID_IN2.Text_22.Value := 0
FORM_GRID_IN2.Text_23.Value := 0
DO EVENTS // added and now works as Pablo suggested.



RETURN



I updated this function for others to view. This works
Thanks Franco

Text Box Update

Posted: Fri Mar 24, 2017 7:42 pm
by Pablo César
Do Events, en lugar de MsgBox ?

Re: Text Box Update

Posted: Fri Mar 24, 2017 7:51 pm
by franco
Thank you for quick response Pablo
is there a way to empty the grid before up date instead of visible .f.
I tried deleteallitems but does not update. If I use itemcount := 0. the grid disappears ... looks funny.

Text Box Update

Posted: Fri Mar 24, 2017 7:55 pm
by Pablo César
Si utiliza los elementos de eliminación se vacía la matriz. Entonces necesitará agregar uno a uno.
Creo que hay una manera atravez de una función en C. No me acuerdo ahora.
 
Googled
If you use the deleteallitems will empty the array. Then you will nedd to additem one by one.
I think there a way in C function. I do not remember now.

Re: Text Box Update

Posted: Fri Mar 24, 2017 7:58 pm
by franco
Now working and all is well.
This forum and HMG is amazing.
Thanks again........ Franco

Text Box Update

Posted: Fri Mar 24, 2017 7:59 pm
by Pablo César
Qué bueno que conseguiste ! :D
franco wrote: Fri Mar 24, 2017 7:58 pm This forum and HMG is amazing.
Yes, really is.

Otra idea, seria: eliminando el control Grid e recriarlo nuevamente con la matriz ya elaborada.