❔ need some help for school assignment - changing image via variable
hey, having problems building a microsoft form in c#, part of my assignment is to build a basic educational game, in order to make it slightly more friendly to children my group decided to add an option to pick a profile image just as an additional thing to keep kids from being completely bored to death. I have tried a few different methods and cannot get the image to change unless its an event on clicking the initial selection of images (image 1), this also assigns a variable "intProfile" a number and i was hoping that on form2 loading i could use an if statement to change a picture box in the corner. its refusing to work, any help would be greatly appreciated
13 Replies
=
is for assignment
==
is for comparison
And it also gives you a bool
, no need to convert anythingi was being forced to convert to bool, but will test the == to see if that works
globalvar
goddamn that worked, thank you lol
so i can carry the selection over from form to form
If it didn't work, it'd mean C# itself is broken
there is almost definitely a better way to pass data between objects than a bunch of global variables, but would need more context
i was having so many troubles last night getting it to work without it being on click so i figured it would work doing it on load on the next form, just forgot the double == lol
also, you don't need
Convert
and it's not really used anymorei imagine so but for this class thats how we have been taught and i think they expect to see variables done that way for now
i was getting errors without it
any object has a
ToString()
method defined on it, and to go the other way they have static parsing methods definedAh, a school project
Well, bad practices are to be expected
that was my favorite part about school
being forced to write shitty code because that's how the professors wanted it
yeah going back to school later in life after learning redundant things on byond and gamemaker lol