Is there any function to update the text of a label in Centura/SQLWindows32?
-
For which version? – Chandralal Apr 26 '16 at 11:42
2 Answers
There's another solution if you have the label in front of an input object (i.e. a data field).
Use SalSetWindowLabelText()
function for changing a label's text.
Example: Call SalSetWindowLabelText(dfInput,'YourText')
.
If you have a "standalone" label, then you no other way than the ones described by GuptaSteve.

- 29
- 3
If you are running v6 or above you can treat Background text as if it were a standard object , so set the text directly using its name : Call SalSetWindowText( bkgdTextName , 'Test' )
If prior to v6 ,
On SAM_AppStartUp
• Set bStaticsAsWindows = TRUE
then find its handle :
• Set hWndBkgdMyLabel = VisWinGetHandle( hWnd, 'bkgdTextName', TYPE_BkgdText )
then set text using its handle:
• Call SalSetWindowText( hWndBkgdMyLabel, 'This is the label I really needed' )
Sometimes it's necessary to force repaint of the label
• Call SalUpdateWindow( hWndBkgdMyLabel )
OR
You can the Handle by placing the Label directly before any associated object ( e.g. a DataField ) in the Outline, then :
• Set hWndBkgdMyLabel = SalGetWindowLabel(hWndItem).
It retrieves the handle to the label attached to a button or a data field , so you can then use :
• Call SalSetWindowText( hWndBkgdMyLabel, 'This is the label I really needed' )
Note: bStaticsAsWindows must be TRUE for these last two to work if you are prior to v6

- 790
- 5
- 15