Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox When( ) Method Ignored (Sort of)
Message
From
31/12/2002 10:31:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/12/2002 09:43:52
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00736938
Message ID:
00736956
Views:
11
>Hi, all -
>
>We have a very interesting little problem, which we can replicate. I was wondering if anyone else can verify that this is happening...
>
>There is a (baseclass) combobox, named "Combo1" on a (baseclass) form. It is the only control on the form.
>
>Combo1.When:
>
>RETURN .F.
>
>
>Combo1.Init:
>
>LOCAL ln1, lc1, i
>
>CREATE CURSOR cTemp1 (x C(10))
>FOR i = 1 TO 20
>	APPEND BLANK
>	REPLACE x WITH 'Value ' + ALLTRIM(STR(RECNO()))
>NEXT i
>ln1 = 3
>
>SCAN
>	this.AddItem(x)
>	IF RECNO() = ln1
>		lc1 = x
>	ENDIF
>ENDSCAN
>GO TOP
>this.Value = lc1
>this.Refresh()
>
>
>Next, we run the form.
>
>I would expect that the value of Combo1 cannot change, since the When( ) method returns false. This is not the case. The user can click on the center of Combo1, then drag out of Combo1 (either up or down). This changes the value, a little. Usually only a few values up or down.
>
>This is very scary behavior, as we have hundreds of forms with comboboxes on them, and the default behavior of the framework we are using is to have:
>
>RETURN thisform.editing
>
>in the When clause of all objects, and to only allow editing at certain times.
>
>Can anyone else replicate this (assumed) bug?
>
>BTW, this behavior can be replicated in the following versions of VFP:

>Visual FoxPro 06.00.8862.00 for Windows [May 11 2000 08:51:23] Product ID 82898-815-2171467-96032
>
>Visual FoxPro 07.00.0000.9465 for Windows [Jan 4 2002 02:58:33] Product ID 55181-015-6159696-03285
>
>Visual FoxPro 08.00.0000.2021 for Windows [Aug 21 2002 12:54:57] Product ID 55181-270-5446961-03615

>Thanks for looking.
>
>- George

George,
Couldn't replicate with VFP7 (9465). Replicates with a listbox.
I prefer 'enabled' instead.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform