I have added forms and controls at runtime from menu items I created like this:
After executing other code and moving around in the application, I want to come back and repeat this routine again. However, the only way I can think of to show the form again is from the menu and this triggers an error telling me the item has already been added (I suppose meaning the 'form'...that's logical). How to prevent this? I have several menu items like this. I just want to get back to the form again whether or not I use the menu. If I asked this question before, I apologize, but I can't remember the answer.
Jim Schuchert
B4X:
Sub mnuMultInv_Click
AddForm("frmMultInv","Multiple Inverse")
frmmultinv.color=cSilver
AddTextBox("frmMultInv","txtMultInvRange",145,10,75,20)
AddTextBox("frmMultInv","txtMultInvDisplay",5,55,165,125)
txtmultinvdisplay.multiline=True
AddLabel("frmMultInv","lblmultinv",35,5,105,40,"Range of points separated with a (-)")
lblmultinv.color=cSilver
AddButton("frmMultInv","btnmultinvOK",180,70,45,20,"OK")
AddButton("frmMultInv","btnmultinvmenu",180,100,45,20,"Menu")
AddButton("frmMultInv","btnmultinvreset",180,130,45,20,"Reset")
frmmultinv.show
txtmultinvrange.focus
End Sub
After executing other code and moving around in the application, I want to come back and repeat this routine again. However, the only way I can think of to show the form again is from the menu and this triggers an error telling me the item has already been added (I suppose meaning the 'form'...that's logical). How to prevent this? I have several menu items like this. I just want to get back to the form again whether or not I use the menu. If I asked this question before, I apologize, but I can't remember the answer.
Jim Schuchert