I want to add a numeric keypad to about 15 forms but only want to design one and have it placed on the others at runtime (copying and pasting doesn't work). It would be in a panel with each number a very small button and I would code what happens when a numbered button is pressed. I experimented with addobject and addpanel but apparently don't know what I'm doing. I did it (with expert help) in NSBasic by using code like this in the load event for each form:
SetParent frame2,area_form
frame2.move 156,130 'adjusted the location of the keypad
formname="area"
The actual designed keypad (in frame2) appeared on only on 1 form and the others were added at runtime as a form was called. I'm confident it can be done in b4ppc but need some direction. Thanks.
The code demonstrates how to add a panel at runtime, how to add a button to it and how to cause it to pop up. It also shows how to consume the relevant events.
You can try it out this and I will be glad to help you out. I guess we can try developing a module that does just this and publish it - many programmers encounter this need.
You will probably have questions - please post them here.
Thank you. I got that far but am hung up when I need to enter numbers from the keypad into various text boxes. I can't seem to get the 'focus' syntax correct when going from tb to tb. For example:
Sub btn1_click
If tb1.focus = True Then 'this is first text box don't know syntax
tb1.text=tb1.text & "1"
Else
If tb2.focus = True Then 'this is second text box
tb2.text=tb2.text & "1"
End If
End If
End Sub
where is the button 'numerica' added?
how does the 'timer' come in play?
Thank you Erel, Ariel and Taximania for the great suggestions. Hopefully I can take it from here with the reservation that I can come back for more excellent advice. You guys are awesome.
Incidentally, for whatever reason, I can not get the 'properties' links (in blue)on the right side of the help screen for the 'controls' to work. They hang up IE and I have to restart. Seems like they worked before.