>>>I created a form using the wizard which automatically puts the wizbtns in the form, the sequence of cmd buttons "ADD EDIT REVERT DELETE" etc.
>>>
>>>I need to modify this so that when a person clicks 'ADD', it populates a field with the current recno(). But I can't modify this class. I tried copying the class but I still can't tinker with it. I'd like to know how the 'REVERT' button shows up when the 'ADD" is clicked. Thank you.
>>
>>Hi Tim,
>>Code is in wizstyle.vcx 'txtbtns' class. As far as I remember caption change was done in 'Navrefesh' or 'ButtonRefresh'.
>>You don't need to tinker class code to insert a value in a field though. There are several ways with one being putting it to field's default value.
>>However in your case I think it's dangerous. There you'd be using buffered tables where using recno() is invtation to headaches.
>
>Cetin, when I go to edit property/method when modifying the class I do see a bold "ButtonRefresh". It just has a description. How does this work?
Tim,
Don't touch anything there. You're at wrong place. Do like this to see and edit code :
In properties window make sure you see 'txtbtns' in combo at top, if not select it. Rightclick on title and select 'Non default properties only'. You'll see buttonresh there (you might need to scroll down). Dblclick it to get code window and you should see this code :
* This is a generic routine which refreshes the buttons
* for appropriate table environments.
IF SELECT()# THIS.nWorkArea
SELECT (THIS.nWorkArea)
ENDIF
THIS.SetAllProp()
THIS.cmdFind.Enabled = !THIS.EditMode
THIS.cmdPrint.Enabled = !THIS.EditMode
THIS.cmdExit.Enabled = !THIS.EditMode
THIS.cmdDelete.Enabled = !THIS.EditMode AND !ISREADONLY()
THIS.SetCaption()
As I could see from code caption change is in SetCaption :) Dblclick on Setcaption in proerties window brings this code :
#DEFINE ADD_CAPTION_LOC "\<Add"
#DEFINE EDIT_CAPTION_LOC "\<Edit"
#DEFINE REV_CAPTION_LOC "\<Revert"
#DEFINE SAVE_CAPTION_LOC "\<Save"
IF THIS.EditMode
THIS.cmdAdd.Caption = SAVE_CAPTION_LOC
THIS.cmdEdit.Caption = REV_CAPTION_LOC
ELSE
THIS.cmdAdd.Caption = ADD_CAPTION_LOC
THIS.cmdEdit.Caption = EDIT_CAPTION_LOC
ENDIF
Cetin