Hi,
A program running on the PDA opens via the Show method another form, say the ViewForm. On the Show event in the ViewForm a circle is drawn and via AddImageButton 20 buttons are created. The Image property is not used, just the Text property and the Transparent property (true). Based on GPS data the position of the imagebuttons is changed via the Left and Top property, using a timer. This runs fine.
Now the user leaves that form via the Close method. Somewhat later on the user opens again that ViewForm. The circle is drawn again and the image buttons are newly created and again positioned based on GPS data.
However, also the image buttons which were shown on the moment of closing the ViewForm are shown on the 'old' positions. The new buttons are repositioned based on GPS data; the old ones stay where they are.
When closing the form, I assume that the image buttons are destroyed as they can be recreated without an error message that they exist already.
Should I clear the form before the close? But How?
Am I doing something wrong?
I cannot test it on the PC as I have no separate GPS device.
Please, can somebody help me?
Harry
A program running on the PDA opens via the Show method another form, say the ViewForm. On the Show event in the ViewForm a circle is drawn and via AddImageButton 20 buttons are created. The Image property is not used, just the Text property and the Transparent property (true). Based on GPS data the position of the imagebuttons is changed via the Left and Top property, using a timer. This runs fine.
Now the user leaves that form via the Close method. Somewhat later on the user opens again that ViewForm. The circle is drawn again and the image buttons are newly created and again positioned based on GPS data.
However, also the image buttons which were shown on the moment of closing the ViewForm are shown on the 'old' positions. The new buttons are repositioned based on GPS data; the old ones stay where they are.
When closing the form, I assume that the image buttons are destroyed as they can be recreated without an error message that they exist already.
Should I clear the form before the close? But How?
Am I doing something wrong?
I cannot test it on the PC as I have no separate GPS device.
Please, can somebody help me?
Harry