How do i pass data from one form to another?
eg. i want to click a button in form1 then be able to form2 and see the image of picturebox changed to the one i've chosen
18 Replies
assuming Form1 knows about Form2 that's easy
just set a property on the instance of Form2 from Form1
or pass it in via a method
it's like
i have one main form like main menu
then 3 forms
which have reference of Mainmenu
and i want the data from form1 to form2 not from main menu D:
Keep the data unaware of the forms, that way you have more control over it.
meaning, don't store the data within the forms
I don't see how this changes anything I just said
you can just pass it along
like I assume there's some relationship here that'll allow you to pass the information around
so fundamentally its just a case of adding APIs that let you do that
im too green for this i guess
nah you're just overthinking it
and there is the picture box i want to take image from form1 there
when i click that button
how are you getting from one form to the other
can't read code in images so
you're gonna have to help
i click these buttons on the left
in code
where
so you have the child form
you already change stuff on it when the button is clicked
from what you're showing me here
just give it the image as well?
like this looks to only take the base type
so obv you're gonna need to do it at a point where you know what form it is you're working with
but the gist is the same
literally you can just be like
and you done
you just need to expose something on your item upgrade menu for taking the picture
and then pass it along
okay i'll try this
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View