Hi
Well, now I am at a loss. If, as you say, the Form is already shown in the Panel, how did it get there - do you have localized versions of the Form in multiple places?
Depending on other things, you might need to define the 'nfp' as a variable at Class level so that references are applying to the same Form.
Without seeing the entire code, I would suggest:
Put a statement at Class level for 'nfp' i.e.
Public Class Form1
Dim nfp As New FormPastas
Private Sub Form1_Load(sender
................
and comment out ALL other Declarations - such as the one in your ButtonClick event Handler. Then try to compile. Fix any exceptions thrown and see what happens.
The way you show means you are declaring another version of FormPastas, not even showing it, but then trying to refer to the ORIGINAL FormPastas that you say is already shown. This can not work as when you then try to access any Control on the OLD FormPastas, you are actually referring to Controls on the NEW FormPastas.
Hopefully that makes sense to you.
As a general question: why are you using Forms in the Panel instead of just adding Controls to the Panel and manipulating the data of those? If you check the code I posted, you will see that all I am doing is adding ONE version of the new Form in the Panel and from there, I just alter the data shown as needed.
I suspect that you really do not need to deal with other complexities arising from using new Forms in the Panel.