General information
Category:
Coding, syntax & commands
>>I want to create a textbox in code from a command button use the textbox to enter so text and then destory the
>>text box after I am done with it. I want to know If it is posiable to do this in visual foxpro 5.0a. If so what would the code look like to do it? I do realize that I could create the text box at design time and play with the
>>visiable properity. But I want to create the textbox at runtime not design time.
>>
>>
>>Frank H. Shaw
>>fshaw@runestones.com
>
>**** cmd Click event
>thisform.addobject("text12","textbox")
>with thisform.text12
> .left=5
> .width=100
> .top=15
> .visible=.t.
>endwith
>**** another cmd Click event
>thisform.removeobject("text12")
Edward Pikman I created this code but it will not work can you tell me what is wrong with the code. I am geting syntax errors trying to get out of the editor.
if !(plEdit_Flag)
plEdit_Flag = .T.
&& We need to create on this form a textbox that we can use to type in the name
&& of the company because we do not want to type the name directly into the combobox
ThisForm.cntbizcompany.ADDOBJECT("txtEditCompany","textbox")
thisform.cntbizcompany.txteditcompany.FontSize = 9
thisform.cntbizcompany.txteditCompany.height = 22
thisform.cntbizcompany.txteditCompany.left = 228
thisform.cntbizcompany.txteditCompany.top = 7
thisform.cntbizcompany.txteditCompany.visible = .T.
thisform.cntbizcompany.txteditCompany.width = 301
thisform.cntbizcompany.txteditCompany.name = "txtEditCompany"
thisform.cmdeditcompany_name.caption = "Remove"
DEFINE CLASS mytextbox AS txtEditCompany
PROCEDURE keypress
LPARAMETERS nKeyCode, nShiftAltCtrl
if nKeyCode = 13
Set Step On
Endif
ENDPROC
ENDDEFINE
else
&& plEdit_Flag True
&& We need to remove the textbox from this form
ThisForm.cntbizCompany.RemoveObject("txtEditCompany")
plEdit_Flag = .F.
thisform.cmdeditcompany_name.caption = "Edit"
Endif
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only