Evil combo box resizing problem

I use combo boxes in a resizable dialog.

But I noticed that if I resize the controls (I use DeferWindowPos for 
flicker-free resize),and there is a matching string text in the list (for 
example, if the edit field contained "B", and there was "Base" string), the 
text in the combobox gets replaced with the matching string and the text 
gets selected (as if the drop-down list was opened and closed). I don't want 
that. How can I disable it?


0
alegr (1131)
12/29/2004 4:29:31 AM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
1620 Views

Similar Articles

[PageSpeed] 18

>I use combo boxes in a resizable dialog.
>
>But I noticed that if I resize the controls (I use DeferWindowPos for 
>flicker-free resize),and there is a matching string text in the list (for 
>example, if the edit field contained "B", and there was "Base" string), the 
>text in the combobox gets replaced with the matching string and the text 
>gets selected (as if the drop-down list was opened and closed). I don't want 
>that. How can I disable it?

Alexander,

This sounds like a quirk/bug of the combo box.

What OS's does this occur with?

Can you reproduce the problem with a simple example - perhaps just by
resizing or moving the combo box without using DeferWindowPos?

PSS ID Number: 87345 "HOWTO: Use the DeferWindowPos Family of
Functions" mentions some display quirks of controls - you could try
what's suggested there.

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2060)
12/29/2004 9:44:29 AM
I first noticed it under XP, then tried under Win98SE - same thing.

"David Lowndes" <davidl@example.invalid> wrote in message 
news:kqu4t0ljv76pggo3jg4g0seqc9ugiv0776@4ax.com...
> >I use combo boxes in a resizable dialog.
>>
>>But I noticed that if I resize the controls (I use DeferWindowPos for
>>flicker-free resize),and there is a matching string text in the list (for
>>example, if the edit field contained "B", and there was "Base" string), 
>>the
>>text in the combobox gets replaced with the matching string and the text
>>gets selected (as if the drop-down list was opened and closed). I don't 
>>want
>>that. How can I disable it?
>
> Alexander,
>
> This sounds like a quirk/bug of the combo box.
>
> What OS's does this occur with?
>
> Can you reproduce the problem with a simple example - perhaps just by
> resizing or moving the combo box without using DeferWindowPos?
>
> PSS ID Number: 87345 "HOWTO: Use the DeferWindowPos Family of
> Functions" mentions some display quirks of controls - you could try
> what's suggested there.
>
> Dave
> -- 
> MVP VC++ FAQ: http://www.mvps.org/vcfaq 


0
alegr (1131)
12/29/2004 4:00:47 PM
>I first noticed it under XP, then tried under Win98SE - same thing.

OK, how about the other points I mentioned?

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2060)
12/29/2004 5:02:06 PM
The note about SWP_NOREDRAW in thet KB article is not related to the 
problem. Actually, the problem still exists if I do plain SetWindowPos 
instead of deferred functions.

I think the combobox control uses WM_SIZE to perform some first time 
initialization (erroneously assuming that it's the only WM_SIZE it will ever 
get). I don't have access to COMCTL sources, so I cannot dig it deeper.

So far, I fixed it with a kludge: I save the edit text and selection and 
reset it before repositioning, then restore its text back.

"David Lowndes" <davidl@example.invalid> wrote in message 
news:jno5t09d9e2sajsc5j9lik29jm22ja516s@4ax.com...
> >I first noticed it under XP, then tried under Win98SE - same thing.
>
> OK, how about the other points I mentioned?
>
> Dave
> -- 
> MVP VC++ FAQ: http://www.mvps.org/vcfaq 


0
alegr (1131)
12/29/2004 9:16:21 PM
>The note about SWP_NOREDRAW in thet KB article is not related to the 
>problem. Actually, the problem still exists if I do plain SetWindowPos 
>instead of deferred functions.

I suspected it might be the same without the deferred option. I was
wondering whether hiding/showing the controls around the SetWindowPos
operation might have prevented the problem you see.

>I think the combobox control uses WM_SIZE to perform some first time 
>initialization (erroneously assuming that it's the only WM_SIZE it will ever 
>get). I don't have access to COMCTL sources, so I cannot dig it deeper.

I don't have access either, so I can't confirm this.

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2060)
12/30/2004 9:58:23 AM
On Tue, 28 Dec 2004 20:29:31 -0800, "Alexander Grigoriev"
<alegr@earthlink.net> wrote:

>I use combo boxes in a resizable dialog.
>
>But I noticed that if I resize the controls (I use DeferWindowPos for 
>flicker-free resize),and there is a matching string text in the list (for 
>example, if the edit field contained "B", and there was "Base" string), the 
>text in the combobox gets replaced with the matching string and the text 
>gets selected (as if the drop-down list was opened and closed). I don't want 
>that. How can I disable it?

I see something similar in a resizable dialog in my application; in my
case, the combo is overlaid on a list view (moves with the selection),
and is hidden during resizing. It does not take on the value of a
matching entry, but simply gets cleared. I haven't investigated
further, but I think it's confirmation that something scwewy is going
on.

--
Sev
0
severian (22)
12/30/2004 11:34:02 AM
David,

I've found the same annoying problem. If a combobox contains a partial match 
for what's in the list and it is resized then the edit text changes to the 
first matching entry. This happens even if it's just minimized. This is most 
annoying. I have a very simple Win32 application which demostrates it if 
you're interested. Send a note to paulg_clarke@uk.ibm.com

Cheers,
P.

"David Lowndes" wrote:

> >I use combo boxes in a resizable dialog.
> >
> >But I noticed that if I resize the controls (I use DeferWindowPos for 
> >flicker-free resize),and there is a matching string text in the list (for 
> >example, if the edit field contained "B", and there was "Base" string), the 
> >text in the combobox gets replaced with the matching string and the text 
> >gets selected (as if the drop-down list was opened and closed). I don't want 
> >that. How can I disable it?
> 
> Alexander,
> 
> This sounds like a quirk/bug of the combo box.
> 
> What OS's does this occur with?
> 
> Can you reproduce the problem with a simple example - perhaps just by
> resizing or moving the combo box without using DeferWindowPos?
> 
> PSS ID Number: 87345 "HOWTO: Use the DeferWindowPos Family of
> Functions" mentions some display quirks of controls - you could try
> what's suggested there.
> 
> Dave
> -- 
> MVP VC++ FAQ: http://www.mvps.org/vcfaq
> 
0
4/1/2005 11:05:06 PM
Reply:

Similar Artilces:

some MS Money problems that have kept me from upgrading
I currently have MS Money 2000. I've purchased Money 2004, but switched back to 2000 because I didn't feel that much was improved. As I'm investigating Money 2007, there are still features missing that I believe it should have. 1) the ability to set up bimonthly payments for mortgages, auto loans, credit cards, etc. Paying bi-monthly can drastically reduce the interest paid over the life of a loan. 2) an easy-to-use balance transfer/consolidation simulator. it would be great to simulate projected savings and effective interest rates when considering balance transfer senario...

Auto Assign Check boxes
Hi, I am trying to create a worksheet on excel which uses a large amount of checkboxes. I am looking for a way to automatically 'assign' these checkboxes to a cell, e.g. when I put a checkbox in Cell A1, the true/false appears in cell B1; when Checkbox is created in (or moved to)cell A2, true/false appears in cell B2. Can anyone help? Sixhobbits. Windows 7 home basic Microsoft office Suite 2007 Only very basic knowledge of VB I would use a macro that added the checkboxes from the Forms toolbar (not the control toolbox toolbar) and assigned the linked cell when the checkboxes were ...

Can not choose in combo
Hello, I have a church membership database. I have the form to input the member data on whch form I also have a combo box to choose the address. If there is no address on the combo list, I add the member address in another form. I can only select it in the member form combo, if I complete filling the address and then return back to previous address. Can any body help me, that I do not need to return back in the address input form? in order to be able to choose it in the member combo form?. Sorry English is not my language, I can not explain it more clearer, but I think yo...

Populate 2nd combo box based on value selected in first combo box?
I have 3 combo boxes. The first one is static inputs, the second need to be populated with inputs (via .AddItem) based on which input th user selects from combobox one. The third needs to be populated (vi .AddItem) based on what the user selects for the input in combobox 2. Is this possible?? Thanks... Chad! BTW..this form runs, but cmbFile is only populated with ".bsn" Private Sub UserForm_Initialize() 'populate the 1st combo box - this is static info With cmbParam .AddItem "Flow" .AddItem "Sediment" .AddItem "Phosphorous" .AddItem "Nitra...

Problem mail merging form Outlook 2007
Hi I am trying to mail merge an html document using outlook contacts. Problem is Outlook 2007 seems to mess up my html and adds a lot of html code presumably due to using word 2007 during mail merge. The mail shot then appears with unwanted attachments on the other side. Is there any way to avoid this? Thanks Regards you should not get attachments - what are they called? -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlo...

Exchange 2003 and Mobile ActiveSync Problem
Hi, I don't know if this is the right thread to post the problems I encountered. I setup Exchange Server 2003 SP1 on a single windows 2003 computer, which is one of the domain controllers with GC as well. I also installed digital certificate issued by one of my internal CA. OWA, OMA and RPC over HTTP work just perfectly. My next step is to test the mobile feature of exchange. I bought DELL AXIM, a Windows Mobile based PDA with ActiveSync Feature pre-installed. Here is how I configured the Active Sync: 1. On server side, I goto System Manager>Global Setting>Mobile Service...

Parameter Input box
In trying a different way of logging deliveries to an order, I decided to put the delivery information directly into the OrderDetails table instead of a DeliveryLog table. I copied the forms, changed the record source, and changed the form names in the command button that opens the form. The form opens from a list box displaying all outstanding orders with the criteria ListBox0.OrderID = frmDailyDeliveryLog.OrderID. When I try to open the frmDailyDeliveryLog, I get a parameter input prompt for "DeliveryID". I've deleted the relationship and the DeliveryLog table from t...

Getting rid of the evil border
When I print two pages per sheet in Publisher, it always prints a black border around each page - how can I make it stop? Does this article supply a solution? It is always helpful to know the version of Publisher. Thin line is displayed and printed around the object when you apply a combination of a border and a fill to the object in Publisher http://support.microsoft.com/kb/290911/en-us -- Mary Sauer http://msauer.mvps.org/ "DaveCujoPI" <DaveCujoPI@discussions.microsoft.com> wrote in message news:7B44B558-6FC5-478A-9946-1D4090301A2C@microsoft.com... > When I print...

Combo box
I want to use a combo box as a drop down list. I know where to find the combo box (in the control toolbox), but I have no idea how to populate it or activate it... Any help will be appriciated for this real novice Rob. Assuming you want a combo box in sheet 1: Make a list in sheet, lets say A1:A5. Name this list "mylist' Draw your combo box in sheet one. Right click on it and choose format control. the input range would be =mylist the cell link will be anywhere you want (such as C10) Depending on what you choose from the drop down, C10 will change accordingly. HTH For more h...

Auto Resize of Picture Attachments
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Email Client: pop Is there an option in Entourage to resize picture files to more sender friendly size? <br> As a PC user I believe there is an option in Outlook to resize pictures by a specified percentage before sending? <br> In the end I ended up opening IPhoto that has this option when you click on the email option in Iphoto but it would sure be a useful tool in entourage if a person could click on attachments, go to iphoto folder and then import at a user friendly size? <br><br>If anybody knows if...

Problems converting from outlook back to outlook express
Hello, I have Miscrosoft Internet Explorer 6.0. My internet provider does not support Outlook and I would like to change back to Outlook Express. I have done all my configurations, but all my messages have not come through. Also, I would like my folders to come over also. Is this a problem? Can it be done? I have sent mys4elf a new message and that comes through, so I am confused. Can you help? I am lost. ...

Evil coercion
Is there any api that can set the decimal separator to point in the current running program/or thread - not the system setting. I don't think so. The imposter has a declaration to it. This should be placed in the Procedure/or Function to be effective. But vb6 ? Any circumvention?. /se "senn" <senn@homeplace&.fix> schrieb im Newsbeitrag news:uj1BAGlELHA.4816@TK2MSFTNGP04.phx.gbl... > Is there any api that can set the decimal separator to > point in the current running program/or thread - not the system setting. > I don't think so. The impos...

weird Dll problem
Hello everyone thank you for taking the time to try to help. I am having this weird problem developing my first MFC dll in VC++. It is intended to be used from VB6. The problem is that when I am debuging the program that uses the dll in the VB6 environment no matter what I do the call to the dll always returns an error 49 Bad dll naming convention. It does run the code in the dll which is currently a simple messagebox but it does not return any value. However, if I compile the vb6 program and run the compiled executable outside of the vb6 programming environment it works perfectly. Retur...

autofilter problem
Hello, I have two worksheets, the first holds original data. On the second sheet I used copy (from page 1 data), paste special and paste link ....then I used autofilter to sort through the data for only select information. However I seem to have a problem now...when I update the original page 1, I can get the information to appear on page 2 if I refilter the data....however that will only work if I had added the information on page one to the last row or updated existing information....if I try to insert a row to add information, it will not appear on page 2. Not sure what I am doing wrong...

UserForm Text Box to display worksheet cell text
I need a way to display the content of my worksheet cell text 'Site Data' B:1 on a UserForm named LocalizerRef. Thanks in advance for any assitance you may render (please try to not laugh too loudly) Bill The below code will get the cell text to the textbox1 in userform while the form is activated..Right click the userform>View Code and place the below code .. Private Sub LocalizerRef_Activate() Me.TextBox1 = ThisWorkbook.Sheets("Site Data").Range("B1") End Sub -- Jacob "Wmeyer2" wrote: > I need a way to display the ...

Combo Box Problem 12-12-07
I have a combo box on a form (ItemsSent.SentTo) that I want to call into itself for selection, the contacts (SQL field: Contacts: [ContactFirstName] & " " & [ContactLastName]) from the contacts table that belong to the prospect (ProspectTable.ID that has been stored in ItemsSent.CompanyID) that this collateral is being sent to and store the SQL field result (i.e. "John Smith") in the ItemsSent.SentTo field (which is also used on letters (reports)). I don't want it limited to items in the list. I am having trouble figuring this out. I have tried multiple options,...

Missing Payees in pull-down boxes
I had to re-install Money 2005 Standard and update the reinstalled software to V14.0.120.1105 before it reopened my *.mny file. I now have a similar problem to other older postings in this discussion group viz. the Payee drop-down (pull-down} list has a very few old and new payees in it, yet auto-fill will complete the name required. I acknowledge a previous answer that the list contains only those used in the past 12 months, yet my list contains some old and some recent names. How can I re-populate the drop down list, even if only with those payees I most often use? ...

Problem of numbers..
Hi there, i have a problem where i need an employee number to appea automatically next to the first name of the employee's name cell. Let say the first employee number is '1' for the 1st employee (which i entered manually). How would i get the 2nd employee number '2' t appear automatically underneath employee#1 when a new employee is adde to the sheet Via, using the data form. I know the formula is something like: Add 1 to the previous number.. This is so that the next employee numbe increases in steps of 1, and keeps increasing everytime a new employe is added. But it...

To box and the Sent box not be populated on the message in the Sent Items
We are experiencing the problem described by KB 328281 and require the hotfix with with the files following versions. Please advise how to acquire this file. Here is the support doc explaining the symptom and resolution, but no link to the hot fix. It says to contact MS to get the hotfix: http://support.microsoft.com/?kbid=328281 Date Time Size File name -------------------------------------------- 24-Feb-2003 16:24 152,064 Olkintl.msp (Client Patch) 24-Feb-2003 16:27 1,201,152 Olkintlff.msp (Full File Patch) After the hotfix is installed, the global version of this fix will have t...

Flip text box 180 degrees
Is there a way to flip a text box so the text is completely upside-down? I can do drawing objects fine... having trouble with a text box though. Thanks in advance. You can't directly. But you can, this way: press the Print Screen button (near the F12 key), then use Edit/Paste. With the Picture toolbar, crop this down to only the text box. Then USe Edit/Cut, click somewhere on the worksheet, edit Paste. Now you can rotate this object. Bob Umlas Excel MVP But -- why would you want to do this? You from Australia? :-) "Mikey" <Mikey@discussions.microsoft.com> wrote in mess...

123 Robotics Experiments for the Evil Genius.exe (7/7)
=ybegin part=7 line=128 size=1593890 name=123 Robotics Experiments for the Evil Genius.exe =ypart begin=1497601 end=1593890 �C[=@a=}�/��`�5Ҵ�b��,�'���r�?������/��3NV���q���w�3x��`A���7,$D2=J_SOfu�4p�"��Z&N�褜#-n���̷�@��r�/��5�QҬу��� I͠)?{7@�%��[�ym�z��^�~�:���ڑYdkŝ��� Dx���@3��8�p+�"y��$E�ޓeْ2�b<=}STTY]�=@T9W�6����P�%��C��^o�x+1��c�5[O|N�I�KD xb��1Œ�bz$Ӭk�#⺶H���C:��h��,E�?�\?���~��0볈�j�+���T���ay�$���Y%��-��5���<=}�i+�?O�7�#�m�%V�d��9Bc>Qv_;=}�V��w� ��&�S�F6����3���/;^�n�x��=J���>�$��H���WK�\�-�v�+:dyw�=J��A���n���J...

onLButtonUp problem!!!
Just found onLButtonUp event won't be triggered if you release the mouse button in the area of a button, to catch the probelm, you can push down the left button and hold it, then move the cursor to a position which is on the top of a button, then release it. In this way onLButtonUp will not be triggered. Is it designed this way in MFC. If so, any API I can call to capture a mouse button release when cursor is inside the rectange of a button? June Deng wrote: > Just found onLButtonUp event won't be triggered if you release the mouse > button in the area of a button, to c...

problem with modal dialog box in a MDI application
I have a mdi application (VC++ 6.0) which uses many modal dialog boxes to get user inputs. I open a dialog box from the application and switch to another application with dialog box still opened. Then i switch back to the first application using alt-tab or using mouse click. Now only the dialog box (that is left in opened state) is drawn in the screen, but its parent application window is not drawn in the background. This gives users the feel like dialog box is for whichever window is in the background (that was present before switching to this application). What could be the pr...

Text Box
Is it possible to insert a text heading, within the border of a text box? Ie. So that the border wraps around the text box as per usual, but in say the top left corner, the border breaks & the heading text is inserted? Jessica wrote: > Is it possible to insert a text heading, within the border > of a text box? > Ie. So that the border wraps around the text box as per > usual, but in say the top left corner, the border breaks & > the heading text is inserted? ======================================= I'm not exactly sure what you are trying to accomplish but it soun...

Strange Active-X control problem
I was experimenting with the Active-X control "Calendar Control" and everything seemed to be fine on my Win2K development system. I tried executing the program on my WinXP desktop system and as soon as I invoked the dialog that includes the control I got the dreaded "XXX MFC Application has encountered a problem and needs to close down..." message. Okay, strike one. Perhaps it means that the control isn't registered on that system and I'd appreciate either confirmation or correction on this. BUT ... Then I also tried executing the program on my Win98SE system an...