Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a toolbar to update a bound control doesn't work
Message
From
24/08/2001 14:37:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Using a toolbar to update a bound control doesn't work
Miscellaneous
Thread ID:
00548871
Message ID:
00548871
Views:
37
Hi All,

I must be doing something fundamentally wrong because because this behavior should have been caught long ago. The problem is that I can't get Foxpro to update the data in a bound control when I use a toolbar. A simplified scenario is below, but I can email a project to anyone who wants to see this behavior. By the way, this is in VFP 6.0 service pack 5, using Windows 98.

***************

Using the standard controls that come with Foxpro:

create a toolbar class.
add 1 button btnSave.
btnSave.click event:
TABLEUPDATE(1, .t., "tFolder")
Thisformset.frmForm.Refresh()

create a form named frmForm.
add a textbox named txtChar to the form.
add a button named btnSave to the form.
add a button named btnCancel to the form.
create a formset for the form.

in the formset init add the toolbar.

in the frmForm.Init:
select name from folder and .t. into cursor tTemp
use dbf("tTemp") again in 0 alias tFolder
=cursorsetprop("buffering", 5, "tFolder")
thisform.txtChar.ControlSource = "tFolder.Name"

in btnSave.Click:
=tableupdate(1, .t., "tFolder")
Thisform.Refresh()

in btnCancel.Click:
=tablerevert(.f., "tFolder")

*************

Run the form and make a change in the textbox. If you hit the cancel button, the data reverts as it should. If you hit the save button, the data is updated as it should. If you click on the save button in the toolbar, the data gets reverted back to its original value. I have also tried putting thisformset.frmForm.btnSave.click() in the click event of the save button on the toolbar but I get the same result. NOW, open the debugger and set a breakpoint for the click event of the toolbar. If you step through the debugger, the data is updated like it should be. This behavior is very consistent. I'm going to try re-installing Visual Studio on a fresh drive to see if that will make any difference.

TIA

Bob
Next
Reply
Map
View

Click here to load this message in the networking platform