|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
rtftextbox, xml and imageload questionsHi,
I'm in the final stages now of writing a piece of software for my students and just need to put in the help files. As it's quite a scientific piece (it's for my Chemistry students), I've decided to use an RTF TextBox gadget and create using OpenOffice the helpfiles (saved out as rtf). I've added them to my project (I'm using MD 2.0), but getting them to work is a pain! How do I load an rtf file from the global namespace into the gadget? I currently have helptext.Loadfile(global::molarity.Properties.Resources.ratio, RichTextBoxStreamType.RichText); am I doing this correctly and will the output include the formatting using different fonts etc from the source RTF? Next two are related. I have an XML file with a load of periodic table data in. I click on a label, it fires off the click event. I've a search routine which loads the correct data and puts it into some other labels. Only problem is the associated image isn't loaded. I have a picture box defined (call it element). What I have in the XML file is the global::molarity.Property.Resources.imagename for the image associated with the element in question. Unfortunately, when I try to load the image, the software dies as it's claiming the image doesn't exit. I've run a debugger through the code and the string returned when reading the xml line is correct (for example hydrogen returns global::molarity.Properties.Resources.Hydrogen which corresponds to the file Hydrogen.jpg in the Resources directory). Should I be using element.LoadImage() to load the image followed by an invalidate()? or should it be done another way? TTFN Paul -- Sie können mich aufreizen und wirklich heiß machen! _______________________________________________ Mono-winforms-list maillist - Mono-winforms-list@... http://lists.ximian.com/mailman/listinfo/mono-winforms-list |
|
|
Re: rtftextbox, xml and imageload questionsPaul wrote:
> Hi, > [snip] > I've run a debugger through the code and the string returned when > reading the xml line is correct (for example hydrogen returns > global::molarity.Properties.Resources.Hydrogen which corresponds to the > file Hydrogen.jpg in the Resources directory). Should I be using > element.LoadImage() to load the image followed by an invalidate()? or > should it be done another way? It would be helpful if you show us some code excerpt for this. Are using something like below? <element image="Resources/Hydrogen.jpg" ... /> element.LoadImage(node.GetAttribute("image")) If so, then Hydrogen.jpg should be located in the Resources subdirectory of current directory when your program is running. It won't "magically" find the needed file even if it was compiled into your program resources. Typically, you use resources for hard-coded images (more generally, data), not for data which location is specified in external files like in your xml. -- Regards, Alex _______________________________________________ Mono-winforms-list maillist - Mono-winforms-list@... http://lists.ximian.com/mailman/listinfo/mono-winforms-list |
| Free embeddable forum powered by Nabble | Forum Help |