On 03.02.2010 15:44, PFJ wrote:
>
> I have a pile of resources for a project which the resource manager handles
> quite nicely. I have an XML file which contains the name of the resource,
> but stored as a string rather than as an Image (it's the name of the
> resource).
>
> Is there a way that I can have
>
> pictureBox1.Image = foo.Properties.Resources.filename where filename is the
> string that contains the filename? I've tried casting the string, but
> nothing.

pictureBox1.Image = Image.FromFile(foo.Properties.Resources.filename);

> I have an rtf text box and I have two rtf files held in the resources. I
> created the rtf files in OpenOffice and can load them back in and the
> formatting is there.
>
> I try to load them into a form using
>
> helptext.LoadFile(global::molarity.Properties.Resources.molarmass,
> RichTextBoxStreamType.RichText);
>
> and it comes out in plain text. No formatting or anything like that.
>
> Am I missing something here?

Maybe OOO's RTF output is too complex for RichTextBox' little brain.
Try to edit this RTF file with WordPad (it comes with Windows).
This tool is known to generate suitable RTFs.

Robert

_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to