Page 1 of 1
Combobox Tooltip for long Values
Posted: Tue Jan 25, 2022 10:10 am
by Frank Müßner
Hi
I use VOForms and I'm looking for a way to show tooltips for longer entries in a combo box. Is there a solution, or am I just not finding the relevant entry.
Frank
Combobox Tooltip for long Values
Posted: Wed Jan 26, 2022 6:15 am
by Karl-Heinz
Hi Frank,
To make all items readable, simply adjust the width of the opened combobox
This sets the width to e.g. 300 pixels.
SendMessage(oYourCombo:Handle(), CB_SETDROPPEDWIDTH, 300 , 0L )
.
regards
Karl-Heinz
Combobox Tooltip for long Values
Posted: Wed Jan 26, 2022 8:22 am
by Frank Müßner
Hi Karl-Heinz,
thanks for this Info. Not a Tooltip solution, but i can use this.
Regards, Frank
Combobox Tooltip for long Values
Posted: Wed Jan 26, 2022 8:55 am
by Karl-Heinz
Hi Frank,
The combobox has a buildin tooltip, but it only popups when the combobox is closed. There are several optionss to refresh the tooltip text.
- if the combobox is linked to a server field, refresh the text in the notify()
Code: Select all
METHOD Notify (kEvent, uDescription) CLASS Yourwin
LOCAL xReturn := SUPER:Notify(kEvent,uDescription)
DO CASE
CASE kEvent >= NotifyRecordChange .AND. kEvent <= NotifyGoTop
oDCyourcmb:Tooltiptext := oDCyourcmb:GetItem(0)
ENDCASE
RETURN xReturn
- listen to the ListBoxSelect() event
Code: Select all
METHOD ListBoxSelect(oControlEvent) CLASS YourWin
LOCAL oControl AS Control
oControl := IIF(oControlEvent == NULL_OBJECT, NULL_OBJECT, oControlEvent:Control)
SUPER:ListBoxSelect(oControlEvent)
//Put your changes here
IF oControl:NameSym == #yourcmb
oDCyourcmb:Tooltiptext := oDCyourcmb:GetItem(0)
ENDIF
RETURN NIL
regards
Karl-Heinz
Combobox Tooltip for long Values
Posted: Wed Jan 26, 2022 9:04 am
by Frank Müßner
Hi Karl-Heinz,
thanks, that I can use before I can replace with a .Net Control
Regards, Frank
Combobox Tooltip for long Values
Posted: Thu Jan 27, 2022 2:56 pm
by Karl-Heinz
Guys,
i couldn´t resist to add two comments about comboboxes. FOr those who didn t notice it til now:
1) mouse wheel behaviour
- activate with the mouse a comboBox
- move the mouse away from the combobox
- now torture the mouse wheel
- you should notice that the comobox selection changes !
to avoid this IMO dangerous behaviour add this to a comboxBox dispatcher
Code: Select all
METHOD Dispatch ( oEvent ) CLASS myCmb
IF oEvent:message == WM_MOUSEWHEEL
IF SendMessage(SELF:Handle(),CB_GETDROPPEDSTATE,0,0L ) == 0
RETURN SELF:EventReturnValue := 1L
ENDIF
ENDIF
RETURN SUPER:Dispatch ( oEvent )
now the mouse wheel only works when the comboBox is opened.
2.) CB_SETEXTENDEDUI
Code: Select all
Sendmessage ( <ocmb>:Handle() , CB_SETEXTENDEDUI , 1 , 0L )
this strange setting exists since VISTA, and after all i still don´t get it why MS added this "feature" at all ?
See the REMARKS section that describes the behaviour (sic) of this setting.
https://docs.microsoft.com/en-us/window ... extendedui
regards
Karl-Heinz