Fehler bei Argumentübergabe

exiter28

Erfahrenes Mitglied
HI,

würde mir einer von Euch einen Tipp geben, was hier falsch ist?
Also das Problem tritt dann auf, wenn ich die Methode aufrufe z.B.:
LoadFigure(2,ListBox,null,null);
anscheinend kann hier kein null übergeben werden. Hättet Ihr einen Tipp
wie man das lösen könnte?

Danke!

Code:
            public static void LoadFigure(int arrayPos, ListBox lb, RichTextBox rtb, Label lbl)
            {
                string constring = IniClass.arraybg[arrayPos];
                System.Drawing.FontConverter confont = new System.Drawing.FontConverter();                
                System.Drawing.Font text = default(System.Drawing.Font);
                text = (Font)confont.ConvertFromString(constring);                
                if ((object)lb == null) { }
                else { lb.Font = text; }
                if ((object)rtb == null) { }
                else { rtb.Font = text; }
                if ((object)lbl == null) { }
                else { lbl.Font = text; }
            }
 
Zurück