I have problems with Labels../Tengo problemas con Labels....

HMG en Español

Moderator: Rathinagiri

Post Reply
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

I have problems with Labels../Tengo problemas con Labels....

Post 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
Attachments
GridFoto.rar
(848.98 KiB) Downloaded 406 times
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: I have problems with Labels../Tengo problemas con Labels

Post 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
Attachments
GridFoto.rar
(848.98 KiB) Downloaded 380 times
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: I have problems with Labels../Tengo problemas con Labels

Post 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
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: I have problems with Labels../Tengo problemas con Labels

Post by Leopoldo Blancas »

Thank Dr. Claudio .... It worked pefect ...
Polo
*---------------------------------------------------------------------------------
Muchas Gracias Dr. Claudio.... Funciono Pefecto...
Polo
Post Reply