Hi everyone, does anyone know how I can disable pressing the up or down arrow when the focus is on a DCCOMBOBOX?
I want to be able to select only with the right button.
Regards and thanks for your help
DCCOMBOBOX
Re: DCCOMBOBOX
It would require a change to express++ source code to allow a select from the right mouse button.
Do you also want to disable the left mouse button?
Do you also want to disable the left mouse button?
The eXpress train is coming - and it has more cars.
Re: DCCOMBOBOX
Thanks for the reply Roger
I don't want to disable any mouse buttons I just want the Up or Down keys to not be able to select any option from the dccombobox array. I use Xbase 1.9
I don't want to disable any mouse buttons I just want the Up or Down keys to not be able to select any option from the dccombobox array. I use Xbase 1.9
Re: DCCOMBOBOX
Here is an example of how to disable keys in the combobox using a custom event handler:
Code: Select all
#INCLUDE "dcdialog.ch"
#INCLUDE "appevent.CH"
FUNCTION Main()
LOCAL GetList[0], GetOptions, aComboCaptions, aComboValues, ;
bGetSet, cComboCaption, nComboValue, oComboBox
aComboCaptions := { ;
'Nineteen Ninety Seven' , ;
'Nineteen Ninety Eight' , ;
'Nineteen Ninety Nine' , ;
'Two Thousand' , ;
'Two Thousand One' , ;
'Two Thousand Two' , ;
'Two Thousand Three' , ;
'Two Thousand Four' , ;
'Two Thousand Five' }
aComboValues := { ;
1997, ;
1998, ;
1999, ;
2000, ;
2001, ;
2002, ;
2003, ;
2004, ;
2005 }
cComboCaption := ''
nComboValue := 2002
@ 1,1 DCSAY 'Choose a year' SAYSIZE 0 SAYBOTTOM
bGetSet := DC_ComboGetSetBlock( aComboCaptions, aComboValues, ;
@cComboCaption, @nComboValue )
@ 1, DCGUI_COL + 10 DCCOMBOBOX bGetSet ;
LIST aComboCaptions ;
SIZE 20, 10 ;
OBJECT oComboBox ;
ITEMSELECTED DC_ComboSelectedBlock( aComboCaptions, aComboValues, ;
@cComboCaption, @nComboValue )
DCREAD GUI FIT ADDBUTTONS TITLE 'Combobox Test' HANDLER myHandler REFERENCE @oComboBox
DCMSGBOX 'You selected the year ' + Alltrim(Str(nComboValue))
RETURN nil
* ------------
PROC appsys
RETURN
* ------------
STATIC FUNCTION myHandler(nEvent,mp1,mp2,oXbp,oDlg,GetList,oComboBox)
IF nEvent == xbeP_Keyboard .AND. oXbp == oComboBox
RETURN DCGUI_IGNORE
ENDIF
RETURN DCGUI_NONE
The eXpress train is coming - and it has more cars.
Re: DCCOMBOBOX
Thank you very much Roger, this is the solution I was looking for.
I had a dccombobox and a dcbrowse in the same window, when I moved through the rows of the dcbrowse with the up or down keys it sometimes jumps to the dccombobox and starts selecting options from the array.
The problem is solved
![Clap :clap:](./images/smilies/eusa/clap.gif)
I had a dccombobox and a dcbrowse in the same window, when I moved through the rows of the dcbrowse with the up or down keys it sometimes jumps to the dccombobox and starts selecting options from the array.
The problem is solved
![Clap :clap:](./images/smilies/eusa/clap.gif)
![Clap :clap:](./images/smilies/eusa/clap.gif)
![Clap :clap:](./images/smilies/eusa/clap.gif)
Re: DCCOMBOBOX
By your description, the cause of the problem is in dcbrowse and not in dccombobox???? You should handle dcbrowse keys and not dccombobox keys.
Best regards,
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs