Dear all,
I Already create a object form with 2 button with this code :
VIEW.CODE 1
As we see at that code (VIEW.CODE 1), it will create as many button as this we write this code (VIEW.CODE 2):
VIEW.CODE 2
My Problem is, How to make a button with that code (VIEW.CODE 1) which is create by looping process, such as Do While (maybe something like that).
So I can make 2 or 3 or 5 button with looping proccess, and when we press each button the messagebox will be show :
"Button 1" if I press button 1
"Button 2" if I press button 2
"Button 2" if I press button 2
Is that posible?
Please help me to answer this problem.
Thank you in advance.
I Already create a object form with 2 button with this code :
VIEW.CODE 1
Code:
frmMyForm = CREATEOBJECT('Form') && Create a Form
frmMyForm.Closable = .t.
frmMyForm.AddObject('button1','cmdMyCmndBtn') && Add Command button
frmMyForm.button1.top=40
frmMyForm.button1.caption="Button 1"
frmMyForm.button1.Visible =.T.
frmMyForm.AddObject('button2','cmdMyCmndBtn') && Add Command button
frmMyForm.button2.top=80
frmMyForm.button2.caption="Button 2"
frmMyForm.button2.Visible =.T.
frmMyForm.SHOW && Display the form
READ EVENTS && Start event processing
DEFINE CLASS cmdMyCmndBtn AS CommandButton && Create Command button
Left = 125
Top = 10
Height = 25
PROCEDURE Click
MESSAGEBOX("Button Pressed")
ENDDEFINE
As we see at that code (VIEW.CODE 1), it will create as many button as this we write this code (VIEW.CODE 2):
VIEW.CODE 2
Code:
frmMyForm.AddObject('button2','cmdMyCmndBtn') && Add Command button
frmMyForm.button2.top=80
frmMyForm.button2.caption="Button 2"
frmMyForm.button2.Visible =.T.
My Problem is, How to make a button with that code (VIEW.CODE 1) which is create by looping process, such as Do While (maybe something like that).
So I can make 2 or 3 or 5 button with looping proccess, and when we press each button the messagebox will be show :
"Button 1" if I press button 1
"Button 2" if I press button 2
"Button 2" if I press button 2
Is that posible?
Please help me to answer this problem.
Thank you in advance.