Reply to thread

Hi All,


I'm pulling my hair out with this one!


I have this declared:

[code]

    [SkinControlAttribute(201)]

    protected GUIButtonControl btnStatus = null;

[/code]When I use in my code:


[code]

    btnStatus.Label = "Test";

[/code]I get "Object reference not set to an instance of an object" in the Mediaportal.log

I'm sure this has worked before, the only change I can remember is the upgrade from MP1.1.0 to 1.1.1... I think...

This means that "btnStatus" is null at the moment I try to use it, which makes sense as I can't find where it gets binded with the GUIButton with id 201. Should MP bind this for me at the start of my plugin or do I have to do this myself?

If I have to bind it myself, how do I do that?


On another thread I found this

[code]

[SkinControlAttribute(1)]

        protected GUILabelControl lblText = (GUILabelControl)GetControl(1); [/code]But this gives me "Error 1    An object reference is required for the non-static field, method, or property 'MediaPortal.GUI.Library.GUIWindow.GetControl(int)'" in Visual C Express...


Could someone enlighten me on this one?


Thanks,

Fripsy.


Top Bottom