wanderso Posted November 7, 2022 Report Share Posted November 7, 2022 Galera tem alguma forma de mudar a cor do objeto combobox quando este ganha foco e está setado como dropdownlist no pelles? Utilizando o COLOR na frente nas redefinições ele é totalmente ignorado. O usuário fica sem saber onde está o foco quando existem vários combos seguidos. Valeu! Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted November 7, 2022 Report Share Posted November 7, 2022 Eu tbm não consegui mudar a cor. Então eu invoquei o método Open() do combobox toda vez que ele recebe o focu e o Close() quando perde o focu. Fica aí a sugestão! Quote Link to comment Share on other sites More sharing options...
kapiaba Posted November 8, 2022 Report Share Posted November 8, 2022 Como assim? Tem como postar o código e o .RC para testes? Abs. Regards, saludos. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted November 8, 2022 Report Share Posted November 8, 2022 JMSilva, Isso? Regards, saludos. Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted November 8, 2022 Report Share Posted November 8, 2022 #include "FiveWin.ch" function Main() local oDlg, oCbx, cDia,cGet:=Space(10),cGet1:=Space(10) DEFINE DIALOG oDlg @ 1,3 get cGet of oDlg size 20,12 @ 2, 3 COMBOBOX oCbx VAR cDia OF oDlg SIZE 100, 300 ; ITEMS { "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domimgo" } ; STYLE CBS_DROPDOWN oCbx:oGet:bKeyChar := {|nKey| oCbx:GetKeyChar( nKey ) } oCbx:bGotFocus := {|| oCbx:Open()} oCbx:bLostFocus := {|| oCbx:Close()} @ 3.6,3 get cGet1 of oDlg size 20,12 ACTIVATE DIALOG oDlg CENTERED return nil Kapi ! Desculpa a demora. O dia foi puxado! Segue um exemplo para vcs ! abraço! Quote Link to comment Share on other sites More sharing options...
kapiaba Posted November 9, 2022 Report Share Posted November 9, 2022 // C:\FWH..\SAMPLES\OCBOPEN.PRG - kapiabafwh@gmail.com #Include "FiveWin.ch" FUNCTION Main() LOCAL oDlg, oCbx, cDia, cGet := Space(10), cGet1 := Space(10), oSay, ; oFont, oBtnX2 DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, -14 BOLD DEFINE DIALOG oDlg FROM 2, 2 TO 18, 60 TITLE "Teste de ComboBox" ; FONT oFont STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, 4 ) oDlg:lHelpIcon := .F. @ 1,3 GET cGet OF oDlg SIZE 20,12 @ 2, 3 COMBOBOX oCbx VAR cDia OF oDlg SIZE 100, 300 UPDATE ; ITEMS { "Lunes", "Martes", "Miércoles", "Jueves", ; "Viernes", "Sábado", "Domingo" } ; STYLE CBS_DROPDOWN ON CHANGE QueDia( cDia ) /* oCbx:oGet:bKeyChar := {|nKey| oCbx:GetKeyChar( nKey ) } oCbx:bGotFocus := {|| oCbx:Open()} oCbx:bLostFocus := {|| oCbx:Close()} */ oCbx:oGet:bKeyChar := { | nKey | If( nKey == VK_RETURN, ; ( cDia := oCbx:oGet:GetText(), ; Eval( oCbx:bChange() ) ),), ; oCbx:GetKeyChar( nKey ) } @ 3.6,3 get cGet1 OF oDlg SIZE 20,12 @ 5, 03 SAY oSay PROMPT "Teste de ComboBox" SIZE 150, 14 OF oDlg ; COLOR CLR_BLACK,CLR_WHITE UPDATE @ 070, 145 BTNBMP oBtnx2 SIZE 30, 30 OF oDlg FLAT NOBORDER ; PROMPT "Exit" FILENAME "..\bitmaps\16x16\Exit.bmp" BOTTOM ; COLOR CLR_BLACK, nRgb( 238, 236, 219 ) ACTION( oDlg:End() ) oBtnX2:lCancel := .T. ACTIVATE DIALOG oDlg CENTERED oFont:End() RETURN NIL FUNCTION QueDia(cDia) MsgAlert("Hoy día es: "+cDia) RETURN NIL // FIN / END Regards, saludos. Quote Link to comment Share on other sites More sharing options...
wanderso Posted November 10, 2022 Author Report Share Posted November 10, 2022 Em 08/11/2022 at 18:59, Jmsilva disse: #include "FiveWin.ch" function Main() local oDlg, oCbx, cDia,cGet:=Space(10),cGet1:=Space(10) DEFINE DIALOG oDlg @ 1,3 get cGet of oDlg size 20,12 @ 2, 3 COMBOBOX oCbx VAR cDia OF oDlg SIZE 100, 300 ; ITEMS { "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domimgo" } ; STYLE CBS_DROPDOWN oCbx:oGet:bKeyChar := {|nKey| oCbx:GetKeyChar( nKey ) } oCbx:bGotFocus := {|| oCbx:Open()} oCbx:bLostFocus := {|| oCbx:Close()} @ 3.6,3 get cGet1 of oDlg size 20,12 ACTIVATE DIALOG oDlg CENTERED return nil Kapi ! Desculpa a demora. O dia foi puxado! Segue um exemplo para vcs ! abraço! Fiz assim também, pelo menos o usuário vê que o combo abriu e sabe onde está. Valeu! Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted November 10, 2022 Report Share Posted November 10, 2022 Show, é isso aí! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.