C
C#11mo ago
guuuh

i need a bit of help with c#

basically, for example if the person presses the black button the label will turn white, if they press the white button the label turns black
No description
25 Replies
Mayor McCheese
Mayor McCheese11mo ago
Why are you subscribed to label click event at all? Based on your problem statement it's only button click events. Maybe you can try setting label color in the button click events for instance
guuuh
guuuhOP11mo ago
thats a good idea but how would i do it?
Mayor McCheese
Mayor McCheese11mo ago
What is the name of the label
guuuh
guuuhOP11mo ago
label1 rn
Mayor McCheese
Mayor McCheese11mo ago
Does label1 have properties you can use? hint: label1.<something>
guuuh
guuuhOP11mo ago
i did: this.label1 = color.white; i can do that
Mayor McCheese
Mayor McCheese11mo ago
Label1.ForeColor for instance
guuuh
guuuhOP11mo ago
just changed it its saying 'forecolor' is not a null here nevermind it just updated but now a diffrent problem
guuuh
guuuhOP11mo ago
No description
Mayor McCheese
Mayor McCheese11mo ago
Label1.ForeColor You're setting the form color With this.
guuuh
guuuhOP11mo ago
oh, soo what do i use?
Mayor McCheese
Mayor McCheese11mo ago
label1 . ForeColor
guuuh
guuuhOP11mo ago
label 1 doesnt exist anymmore
Mayor McCheese
Mayor McCheese11mo ago
What happened to the label?
guuuh
guuuhOP11mo ago
changed it
Mayor McCheese
Mayor McCheese11mo ago
To what
guuuh
guuuhOP11mo ago
to forecolor
Mayor McCheese
Mayor McCheese11mo ago
The name of the label is forecolor?
guuuh
guuuhOP11mo ago
yes
Mayor McCheese
Mayor McCheese11mo ago
So ... what do you think you should type
guuuh
guuuhOP11mo ago
uh im kinda confused
Mayor McCheese
Mayor McCheese11mo ago
forecolor is the name of the control Try forecolor.ForeColor = Color.White;
guuuh
guuuhOP11mo ago
it turned into a exe and died lol
Angius
Angius11mo ago
Damn, code that compiles itself Advanced stuff lmao
guuuh
guuuhOP11mo ago
kekw
Want results from more Discord servers?
Add your server