Page 1 of 1
I have problems with Labels../Tengo problemas con Labels....
Posted: Sat Jan 12, 2013 4:16 am
by Leopoldo Blancas
Hola a Todos....
Estoy practicando con BossTaurus y me encontre con este problema...
Si las Labels les aplico la propiedad BOLD desde un TextBox, por ejemplo, cuando entro con ON GOSTFOCUS y le quito la propiedad de BOLD cuando salgo del Control ON LOSTFOCUS.... La Label se queda en BOLD y distorciona las letras, qué me falta poner o qué omiti ???
Gracias por la posible solución!!!
Saludos
Polo
*----------------------------------------------------------------------------------------------------------------------
Hi Everyone ....
BossTaurus'm practicing and I found this problem ...
If I apply the property Labels BOLD from a TextBox, for example, when I go to ON GOSTFOCUS and removed the property when I leave the Control BOLD ON LostFocus .... The Label stays in BOLD letters and distorts, or do I need to put what I missed???
Thanks for the possible solution!
regards
Polo
Re: I have problems with Labels../Tengo problemas con Labels
Posted: Sat Jan 12, 2013 9:18 pm
by Leopoldo Blancas
Hola a Todos....
Estoy practicando con BossTaurus y me encontre con este problema... Si le asigno la propiedad Form_1.LabelLast.FONTBOLD := .T. a una Label cuando entro a un control y se la quito cuando salgo de ella... se queda en Labels en FONTBOLD = .T. Y DISTORCIONA LAS LETRAS... Alguna Posible solución?
@ 260,010 LABEL LabelLast VALUE "Last Name" WIDTH 95 HEIGHT 25 TRANSPARENT
@ 260,105 TEXTBOX TextBoxLast ;
ON GOTFOCUS(Form_1.LabelLast.FONTBOLD := .T.) ;
ON LOSTFOCUS (Form_1.LabelLast.FONTBOLD := .F.) ;
VALUE "" ;
WIDTH 300 HEIGHT 25
Gracias por la posible solución!!!
Saludos
Polo
*----------------------------------------------------------------------------------------------------------------------
Hi Everyone ....
BossTaurus'm practicing and I found this problem ... If I assign the property Form_1.LabelLast.FONTBOLD: =. T. a Label control when I walk into and take it off when I leave her ... Labels stays in FontBold =. T. And distorts the letters ... A possible solution?
@ 260,010 LABEL LabelLast VALUE "Last Name" WIDTH 95 HEIGHT 25 TRANSPARENT
@ 260,105 TEXTBOX TextBoxLast ;
ON GOTFOCUS(Form_1.LabelLast.FONTBOLD := .T.) ;
ON LOSTFOCUS (Form_1.LabelLast.FONTBOLD := .F.) ;
VALUE "" ;
WIDTH 300 HEIGHT 25
regards
Polo
Re: I have problems with Labels../Tengo problemas con Labels
Posted: Sat Jan 12, 2013 11:10 pm
by srvet_claudio
Hi Polo.
You must force the repainting of the TextBox.
Add InvalidateRect() in the LostFocus().
Best regards,
Claudio.
Code: Select all
#include "hmg.ch"
#include "hfcl.ch"
Function Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 550 ;
HEIGHT 535;
TITLE 'Demo' ;
MAIN NOMAXIMIZE ;
ON PAINT Proc_ON_PAINT_Form_1()
@ 230,010 LABEL LabelFirst VALUE "First Name" WIDTH 95 HEIGHT 25 TRANSPARENT
@ 230,105 TEXTBOX TextBoxFirst ;
ON GOTFOCUS(Form_1.LabelFirst.FONTBOLD := .T.) ;
ON LOSTFOCUS {||Form_1.LabelFirst.FONTBOLD := .F., InvalidateRect (GetFormHandle("Form_1"), NIL, .F.)};
VALUE "" ;
WIDTH 300 HEIGHT 25
@ 260,010 LABEL LabelLast VALUE "Last Name" WIDTH 95 HEIGHT 25 TRANSPARENT
@ 260,105 TEXTBOX TextBoxLast ;
ON GOTFOCUS(Form_1.LabelLast.FONTBOLD := .T.) ;
ON LOSTFOCUS {||Form_1.LabelLast.FONTBOLD := .F., InvalidateRect (GetFormHandle("Form_1"), NIL, .F.)} ;
VALUE "" ;
WIDTH 300 HEIGHT 25
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return Nil
PROCEDURE Proc_ON_PAINT_Form_1()
LOCAL hDC, BTstruct
hDC := BT_CreateDC ("Form_1", BT_HDC_INVALIDCLIENTAREA, @BTstruct)
BT_DrawGradientFillVertical (hDC, 0, 0, BT_ClientAreaWidth("Form_1"), BT_ClientAreaHeight("Form_1"), BLACK, GREEN)
// BT_DrawBitmap (hDC, 30, 150, 400, 400, BT_COPY, hBitmap)
BT_DeleteDC (BTstruct)
RETURN
Re: I have problems with Labels../Tengo problemas con Labels
Posted: Sun Jan 13, 2013 4:56 am
by Leopoldo Blancas
Thank Dr. Claudio .... It worked pefect ...
Polo
*---------------------------------------------------------------------------------
Muchas Gracias Dr. Claudio.... Funciono Pefecto...
Polo