using visual studio I need to modify a variable that exists in the main form from a secondary one.
To move from the main to the secondary I used the ShowDialog property to avoid closing the first because the secondary was small and I use it only to change a variable, but I have no idea how to modify that variable in the main one without creating it again.
IMG 1. Button code in the main form to access the secondary.
In the secondary constructor I pass the variable that I want to modify to put it initially as information
IMG 2. Open and secondary parent form (back) above
In the secondary form I intend to change the pre-shared key for an encryption algorithm that I use in the main form so as not to use the default one (which is not relevant), but I need that change to arrive at the main interface that is where I call the logic classes to execute the algorithm. ---- NOTE: do not look at the interfaces, it's a functional prototype