C
C#6mo 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 McCheese6mo 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
guuuh6mo ago
thats a good idea but how would i do it?
Mayor McCheese
Mayor McCheese6mo ago
What is the name of the label
guuuh
guuuh6mo ago
label1 rn
Mayor McCheese
Mayor McCheese6mo ago
Does label1 have properties you can use? hint: label1.<something>
guuuh
guuuh6mo ago
i did: this.label1 = color.white; i can do that
Mayor McCheese
Mayor McCheese6mo ago
Label1.ForeColor for instance
guuuh
guuuh6mo ago
just changed it its saying 'forecolor' is not a null here nevermind it just updated but now a diffrent problem
guuuh
guuuh6mo ago
No description
Mayor McCheese
Mayor McCheese6mo ago
Label1.ForeColor You're setting the form color With this.
guuuh
guuuh6mo ago
oh, soo what do i use?
Mayor McCheese
Mayor McCheese6mo ago
label1 . ForeColor
guuuh
guuuh6mo ago
label 1 doesnt exist anymmore
Mayor McCheese
Mayor McCheese6mo ago
What happened to the label?
guuuh
guuuh6mo ago
changed it
Mayor McCheese
Mayor McCheese6mo ago
To what
guuuh
guuuh6mo ago
to forecolor
Mayor McCheese
Mayor McCheese6mo ago
The name of the label is forecolor?
guuuh
guuuh6mo ago
yes
Mayor McCheese
Mayor McCheese6mo ago
So ... what do you think you should type
guuuh
guuuh6mo ago
uh im kinda confused
Mayor McCheese
Mayor McCheese6mo ago
forecolor is the name of the control Try forecolor.ForeColor = Color.White;
guuuh
guuuh6mo ago
it turned into a exe and died lol
Angius
Angius6mo ago
Damn, code that compiles itself Advanced stuff lmao
guuuh
guuuh6mo ago
kekw