Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox problem
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00156692
Message ID:
00159235
Views:
52
Hi David,

Thanks for taking the time to test this. I find it odd that it doesn't work for you when coded directly into the combobox but it does for me. I'm using VFP6 with SP1 applied. Are you using the same?

The mycombo.text1 was a revelation to me to. The .KeyPress(0,8) has me stymied as well since there is no ShiftAltCtrl value of 8 and there is also no INKEY() value of 8. Hmmmmmm......

Thanks again

>Colin,
>
>I get the same sequence of events either way. It also clears the Value of the cbo when I use the up/down arrow in the cbo, it doesn't when I tab. Altering the Style of the cbo doesn't seem to be such a good idea. The subclass won't ever display the selected value chosen from the dropped list.
>
>It's rather revealing to see mycombo.text1, it looks like VFP is internally building the cbo from a button and a textbox. And the nShiftAltCtrl value of 8 doesn't make sense according the the help file.
>
>You may have to just stop messing around with Style and set a flag to know how to handle the up/down arrow keys.
>
>>I encountered an odd problem with this solution. If I put this code directly into the combobox on the form it works fine. If I put this code into a combobox class used on a form the UPARROW works fine but the DNARROW blanks out the value. I turned on event tracking for both and discovered the following:
>>
>>**code directly into the combobox on the form
>>myform.KeyPress(24,0)
>>myform.mycombo.KeyPress(24,0)
>>myform.mycombo.text1.KeyPress(24,0)
>>myform.Paint()
>>myform.KeyPress(24,0)
>>myform.mycombo.Valid()
>>myform.mycombo.text1.Destroy()
>>myform.mycombo.LostFocus()
>>
>>**code into a combobox class used on a form
>>myform.KeyPress(24,0)
>>myform.mycombo.KeyPress(24,0)
>><strong>myform.mycombo.text1.KeyPress(0,8)
>>myform.Paint()
>>myform.mycombo.InteractiveChange()</strong>
>>myform.mycombo.text1.KeyPress(24,0)
>>myform.Paint()
>>myform.KeyPress(24,0)
>>myform.mycombo.Valid()
>>myform.mycombo.text1.Destroy()
>>myform.mycombo.LostFocus()
>>
>>
>>I'm at a loss for the extra 3 events. Any thoughts? TIA
>>
>>>Colin,
>>>
>>>Clever solution.
>>>
>>>>I finally came up with a solution that is actually pretty simple and thought I'd pass it along.
>>>>
>>>>In the Combobox.KeyPress I put the following
>>>>IF nKeyCode=5 OR nKeyCode=24     &&UPARROW or DNARROW
>>>>	This.Style=0                                 &&Set Style to Dropdown Combo
>>>>	DODEFAULT()
>>>>ENDIF
>>>>
>>>>In the Combobox.Valid I put
>>>>This.Style=2           &&Set Style to Dropdown List
>>>>
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform