Resizing combo boxes



Hi

I'm having a weird problem with a dropdown combo box (not a dropdown list).

Lets say I have a dialog box with a combo box in it. If the dialog box is resized I resize the combo box to fit the width of the dialog. If the text in the box matches one of the choices in the list, the text is selected every time the control is resized. If the text doesn't match any of the choices then it is not selected. This happens no matter if the control has the focus or not.

The result is that if I have multiple combo boxes, then when the dialog is resized all of the texts get selected and it is hard to figure which one has the focus.

What's even weirder, it happens even if the combo box is disabled. After that I can't deselect the text with the mouse or keyboard, because the control doesn't get any input.

I tried to remove the ES_NOHIDESEL style of the edit child control, but that didn't help. The text is selected and the selection is visible even though the edit box doesn't have the focus. Maybe this is not a style that can be modified after creation.

I tried on XP with and without a manifest. I tried manually resizing the control on WM_SIZE and also with WTL's CDialogResize. There was no difference.

Any ideas how to resize a combo box without selecting the text???


Thanks
Ivo

.



Relevant Pages

  • Re: Data List Insert new problem
    ... Microsoft MSDN Online Support Lead ... I try this solution but it dosen't seems to work so I changed the dropdown ... So for the control display the color lists you selected from database, ... Now when I'm selecting let say GN_ID 35 in the the drop down ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Resizing combo boxes
    ... I'm having a weird problem with a dropdown combo box (not a dropdown ... box is resized I resize the combo box to fit the width of the dialog. ... happens no matter if the control has the focus or not. ... The text is selected and the selection is ...
    (microsoft.public.win32.programmer.ui)
  • Re: Resizing combo boxes
    ... I'm having a weird problem with a dropdown combo box (not a dropdown ... box is resized I resize the combo box to fit the width of the dialog. ... happens no matter if the control has the focus or not. ... The text is selected and the selection is ...
    (microsoft.public.win32.programmer.ui)
  • drop down buttons
    ... selecting a button from a drop down buttons. ... This dropdown button must ... The reason for the need of this control is that. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Autocomplete combobox
    ... combobox is "DropDown". ... The anchor of combo is "Top". ... that own this combo resize, the value of combo is changed. ... When control is resized the Text value of combo is changed to Test3. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)