reading Image Property for button from a XML

D

doubts

Hi,

I have a query regarding reading Image Property for button from a XML
file .
I read XML files to Generate Screens using
System.Windows.Forms.Controls .The XML file is read and properties
are
set using Reflection


a sample representation of it is given below


<Control type="System.Windows.Forms.Button, System.Windows.Forms,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="Button2">
<Property name="TabIndex" value="6"></Property>
<Property name="Size" value="75, 23"></Property>
<Property name="Name" value="Button2"></Property>
<Property name="UseVisualStyleBackColor" value="true"></Property>
<Property name="Text" value="Exit"></Property>
<Property name="Location" value="106, 170"></Property>


Is it possible to specify the Image Property as Given Below
<Property name="Image" value="C:\Data\Image.bmp"></Property>


How can the Image Name read at run time and binded to dynamically
generated assembly.Please advice?


regards
doubts.
 
P

Patrick Steele

Is it possible to specify the Image Property as Given Below
<Property name="Image" value="C:\Data\Image.bmp"></Property>


How can the Image Name read at run time and binded to dynamically
generated assembly.Please advice?

Sure. Just use Image.FromFile to load the image and then set the Image
property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top