How do I resolve nullability of reference types in type of parameter warnings?

27 views Asked by At

I'm getting a warning "Nullability of reference types in type of parameter 'obj' of 'lambda expression' doesn't match the target delegate (possibly because of nullability attributes)."

Here is my code:

tydhouer.Tick += (object obj, EventArgs args) =>
{
    this.BackColor = agtergrond;

    foreach (Control c in this.Controls)
        if (c is RadioButton)
            c.BackColor = agtergrond;

    this.agtergrond = Color.Empty;

    tydhouer.Stop();
};

How can I resolve this?

I've typed the given code to restore the colour of the screen after 3 seconds what it does, but I got green warning squiggles under the following code: (object obj, EventArgs args) =>

0

There are 0 answers