Board index » Visual Studio » CComboBox problem
|
TimWhitley
|
|
TimWhitley
|
CComboBox problem
Visual Studio310
Hi, I need to make CComboBox edit control stretchable with the mouse, something like in IE address box, that user can drag the right corner e.g. more to the right. Is it hard to do? thanks - |
| Jonathan
Registered User |
Tue Aug 01 16:35:08 CDT 2006
Re:CComboBox problem
It's not hard. You can change the size (width only) of a combo box by
calling SetWindowPos() or MoveWindow(). The harder part is intercepting the events that indicate the window must be resized and handling all that correctly. -- Jonathan Wood SoftCircuits Programming www.softcircuits.com">www.softcircuits.com "azuro" <ad@yahoo.com>wrote in message QuoteHi, - |
| Joseph
Registered User |
Tue Aug 01 21:23:14 CDT 2006
Re:CComboBox problem
One way to handle this is to implement a WM_SETCURSOR override for the subclass of the
combo box. Then look at where the cursor is; if it is over the edge (which you can get via GetWindowRect and using values such as ::GetSystemMetrics(SM_CYEDGE) to compute fudge factors) you set a resize cursor (there's one of these images in the images subdirectory of the VS install directory). Then you have to handle the WM_LBUTTONDOWN handler, or maybe the WM_NCLBUTTONDOWN handler, to catch the mouse click. If the mouse click is not on one of the edges, send it to the superclass; otherwise, SetCapture and then use the OnMouseMove handler to deal with the resizing. This is a cute idea...I may take a shot at it. joe On Tue, 1 Aug 2006 15:35:08 -0600, "Jonathan Wood" <jwood@softcircuits.com>wrote: QuoteIt's not hard. You can change the size (width only) of a combo box by Web: www.flounder.com">www.flounder.com MVP Tips: www.flounder.com/mvp_tips.htm">www.flounder.com/mvp_tips.htm - |
| Tom
Registered User |
Wed Aug 02 09:40:56 CDT 2006
Re:CComboBox problem
I believe the IE address box is in a Rebar pane which might make this easier
for you if you want to do that same thing in a toolbar. Tom "azuro" <ad@yahoo.com>wrote in message QuoteHi, - |
| azuro
Registered User |
Wed Aug 02 14:26:11 CDT 2006
Re:CComboBox problem
thanks guys for tips, I'll try.
I was hoping that there is something more automatic though in that control :) "Joseph M. Newcomer" <newcomer@flounder.com>wrote in message QuoteOne way to handle this is to implement a WM_SETCURSOR override for the - |
| azuro
Registered User |
Wed Aug 02 14:27:26 CDT 2006
Re:CComboBox problem
I use it in toolbar but I have already CComboBox impemented.
thanks "Tom Serface" <tserface@msn.com>wrote in message QuoteI believe the IE address box is in a Rebar pane which might make this - |
| Joseph
Registered User |
Wed Aug 02 14:24:36 CDT 2006
Re:CComboBox problem
Send me email, I'll send some code, providing I get it before I leave; otherwise, I'll
send it Sunday or Monday when I return. joe On Tue, 01 Aug 2006 22:23:14 -0400, Joseph M. Newcomer <newcomer@flounder.com>wrote: QuoteOne way to handle this is to implement a WM_SETCURSOR override for the subclass of the Web: www.flounder.com">www.flounder.com MVP Tips: www.flounder.com/mvp_tips.htm">www.flounder.com/mvp_tips.htm - |
