Hi!
when I use for example oEdit1:Value := " Test " the trailing blank space character is deleted.
How can I avoid that?
Best regards, Timm.
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
TEdit
TEdit
Hi Ignacio,
please take a look at the attached modified Edits sample.
Best regards, Timm.
Attached files Edit.zip (3 KB)Â
please take a look at the attached modified Edits sample.
Best regards, Timm.
Attached files Edit.zip (3 KB)Â
TEdit
Hi Ignacio,
calling ::oEdit1:Value := " Test " a second time does not solve the problem.
Best regards, Timm.
calling ::oEdit1:Value := " Test " a second time does not solve the problem.
Best regards, Timm.
TEdit
Hi Ignacio,
this is a missunderstanding. Sorry, my fault.
When you set oEdit1:Value := " Test " the control (oEdit1) receives only " Test".
Best regards, Timm.
this is a missunderstanding. Sorry, my fault.
When you set oEdit1:Value := " Test " the control (oEdit1) receives only " Test".
Best regards, Timm.
- ignacio
- Site Admin
- Mensajes: 9253
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
TEdit
Hi Timm,
I'm afraid that problem arise due the need to trim all the spaces on DBF fields. As you surely remember all the character DBF fields values are filled with spaces up to the length of its field. That was a problem when editing those fields. If we take off that trim operation I'm sure many people will protest.
I suggest you overload the TEdit:SetValue method this way:
METHOD SetValue( Value, lWithEvent ) CLASS TEdit
DEFAULT lWithEvent TO .F.
::FValue := ToString( Value, "" )
::FcText := ::FValue
IF ! Empty( ::Handle ) .AND. !( GetWindowText( ::Handle ) == ::FcText )
IF ! lWithEvent
::lStopEvent := .T.
ENDIF
SetWindowText( ::Handle, ::FcText )
ENDIF
RETURN ::FValue
Best regards,
I'm afraid that problem arise due the need to trim all the spaces on DBF fields. As you surely remember all the character DBF fields values are filled with spaces up to the length of its field. That was a problem when editing those fields. If we take off that trim operation I'm sure many people will protest.
I suggest you overload the TEdit:SetValue method this way:
METHOD SetValue( Value, lWithEvent ) CLASS TEdit
DEFAULT lWithEvent TO .F.
::FValue := ToString( Value, "" )
::FcText := ::FValue
IF ! Empty( ::Handle ) .AND. !( GetWindowText( ::Handle ) == ::FcText )
IF ! lWithEvent
::lStopEvent := .T.
ENDIF
SetWindowText( ::Handle, ::FcText )
ENDIF
RETURN ::FValue
Best regards,