MATLAB: Placing UIPanel on Figure in OpeningFcn

figureMATLABparentuipanel

Hello, I am trying to create an uipanel on a figure during the OpeningFcn using the following line:
bp = uipanel('Units','pixels','Position','[8 41 490 500],'Tag','BackgroundPanel','BorderType','none');
The Panel is created but it's placed on the calling figure. I tried several Parent settings but so far haven't come up with something working so the Panel is on the opening figure.
Can anybody help me with this please?
Best regards, Michael

Best Answer

Inside the OpeningFcn:
bp = uipanel('Units','pixels','Position','[8 41 490 500], ...
'Tag','BackgroundPanel','BorderType','none', ...
'Parent', hObject);
This seems to be the most obvious parent. What did you try?