Friday, September 23, 2011

Having trouble setting the height of a .NET Winform TextBox control?

Make sure multiline is set to true!

GetManifestResourceStream() returns NULL

If like me you're having problems accessing an embedded (assembly) resource using GetManifestResourceStream(), then read on:

GetManifestResourceStream was returning null even though I was pre-fixing the resource name with the namespace, i.e. NameSpace.Resource.ext.

The problem turned out to be the sub directory was missing from the name, in my example my resource lived under a folder (in the solution explorer) called Resources, so changing the qualified name to be:

NameSpace.Resources.Resource.ext fixed the issue.

Hope this helps someone else!