Q:

Using Unity built-in sprites programatically

I'm trying to figure out how to use the "Panel" built in resource in a game I'm making. I've been able to figure out some potential solutions, but I can't quite figure out how to put all of the pieces together. 
panelImage.sprite = UnityEditor.AssetDatabase.GetBuiltinExtraResource<Sprite>("UI/Skin/InputFieldBackground.psd");
panelImage.sprite = Resources.GetBuiltinResource(typeof(Sprite), "Resources/unity_builtin_extra/Background.psd") as Sprite;

The first produces the button sprite, which is almost what I want, but not quite. The second doesn't work at all. I'm missing some small piece of what it takes to make this work, but I can't quite figure it out. How can I use the panel background programmatically?

A:

This isn't recommended practice at all. While there are ways to use built in resources, the images aren't defined, and might have issues if you choose to use them.
What a much better way to do it, and the way that I have done, is to have a prefab defined using the desired format, and instantiate it, rather than attempt to do this all programmatically.

