Jump to content
Fivewin Brasil

Foco em combobox dropdownlist


wanderso

Recommended Posts

#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!

Link to comment
Share on other sites

// 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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...