Błąd po ładowaniu obrazków w konstruktorze kontrolki

0

Jak umieszczę taki kod w konstruktorze kontrolki lub w zdarzeniu Load():

    this.lightimg = Image.FromFile("zapalona.bmp");
            this.darkimg = Image.FromFile("zgaszona.bmp");

to wyskakuje błąd:

To prevent possible data loss before loading the designer, the following errors must be resolved:

1 Error   

Ignore and Continue
Why am I seeing this page?

The variable 'testDiody1' is either undeclared or was never assigned. Go to code

Instances of this error (1)

  1. TestDiody Form1.Designer.cs Line:61 Column:1 Show Call Stack

at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

Help with this error

MSDN Help

Forum posts about this error

Search the MSDN Forums for posts related to this error

O co chodzi?

0

Masz chyba problemy z wyłowieniem właściwego fragmentu komunikatu:

The variable 'testDiody1' is either undeclared or was never assigned.

Chyba wystarczająco jasne?

1 użytkowników online, w tym zalogowanych: 0, gości: 1