Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: prasanna kunder
  Where is prasanna kunder?
 mumbai
 India
 prasanna kunder
 Tags
Subject: RE: how prevent accident key press
Thread ID: 331357 Message ID: 331361 # Views: 51 # Ratings: 1
Version: Visual FoxPro 9 Category: Forms
Date: Thursday, December 29, 2011 8:49:37 AM         
   


> >
> >
> > You have to toggle your buttons. During data entry, disable navigation buttons. After saving, toggle those buttons back to enabled.
> >
> > http://sandstorm36.blogspot.com
> > http://weblogs.foxite.com/sandstorm36/default.aspx
>
> if user don't want to save that entry,
> then what
> thanks


That is why you have cancel button right?

I have not looked properly at your image but considering you have these buttons, on first run of the form, Enabled property should be:

Add - .T.
Edit - .T.
Delete - .T.
Save - .F.
Cancel - .F.

* NAV
Top - .T.
Next - .T.
Preview - .T.
Bottom - .T.

Create a method called Toggle:

with thisform as form 
  .cmdAdd.Enabled = !.cmdAdd.Enabled
  .cmdEdit.Enabled = !.cmdEdit.Enabled
  .cmdDel.Enabled = !.cmdDel.Enabled
  .cmdSave.Enabled = !.cmdSave.Enabled
  .cmdCancel.Enabled = !.cmdCancel.Enabled
  .cmdTop.Enabled = !.cmdTop.Enabled
  .cmdNext.Enabled = !.cmdNext.Enabled
  .cmdPrevious.Enabled = !.cmdPrevious.Enabled
  .cmdBottom.Enabled = !.cmdBottom.Enabled
endwith 


On Add, Edit, Save, and Cancel buttons, call that method:

Thisform.Toggle()


http://sandstorm36.blogspot.com
http://weblogs.foxite.com/sandstorm36/default.aspx

ENTIRE THREAD

how prevent accident key press Posted by prasanna kunder @ 12/29/2011 8:32:41 AM
RE: how prevent accident key press Posted by Jun Tangunan @ 12/29/2011 8:37:43 AM
RE: how prevent accident key press Posted by prasanna kunder @ 12/29/2011 8:39:59 AM
RE: how prevent accident key press Posted by Jun Tangunan @ 12/29/2011 8:49:37 AM
RE: how prevent accident key press Posted by prasanna kunder @ 12/29/2011 9:04:46 AM
RE: how prevent accident key press Posted by Stefan Wuebbe @ 12/29/2011 9:16:46 AM
RE: how prevent accident key press Posted by prasanna kunder @ 12/29/2011 10:05:06 AM
RE: how prevent accident key press Posted by Zul Rahim @ 12/29/2011 11:06:00 AM
RE: how prevent accident key press Posted by Muhammad Majid Ali Attari @ 12/30/2011 6:29:04 AM
RE: how prevent accident key press Posted by prasanna kunder @ 12/30/2011 8:48:51 AM
RE: how prevent accident key press Posted by Jun Tangunan @ 12/30/2011 7:17:14 AM
RE: how prevent accident key press Posted by prasanna kunder @ 12/30/2011 8:48:14 AM