Subject pushbutton
From Mustansir Ghor <mustan31@hotmail.com>
Date Sun, 07 Mar 2021 14:28:44 -0500
Newsgroups dbase.getting-started

Dear All

I happen to use & as accelerator for pushbutton. However the onclick function executes twice with acclerator key. I checked this by putting  ?form.activecontrol.name

I am putting the program bellow


** END HEADER -- do not remove this line
//
// Generated on 07/03/2021
//
parameter bModal
local f
f = new ghor38Form()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.open()
endif

class ghor38Form of FORM
   with (this)
      height = 16.0
      left = 77.5
      top = 0.0
      width = 40.0
      text = ""
   endwith

   this.PUSHBUTTON1 = new PUSHBUTTON(this)
   with (this.PUSHBUTTON1)
      onClick = class::PUSHBUTTON1_ONCLICK
      height = 1.0909
      left = 13.0
      top = 4.0
      width = 15.2857
      text = "Pu&shbutton1"
   endwith

   this.ENTRYFIELD1 = new ENTRYFIELD(this)
   with (this.ENTRYFIELD1)
      height = 1.0
      left = 11.0
      top = 8.0
      width = 8.0
      value = "Entryfield1"
   endwith


   function PUSHBUTTON1_onClick()
      ?form.activecontrol.name
      return

endclass


Can anybody assists me to understand  where is the error so that I can correct

Best Regards
Mustansir