Well Cor. Time to get started on the reader part. I have pretty much
followed ALL you advice and now have an XML file. After I position all the
labels where I want them and set their properties I then open a
savefiledialog box and write out the xml file. Here it is:
<?xml version="1.0" standalone="yes" ?>
- <CPViewer>
- <P1JoyUp>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyUp>
- <P1JoyRight>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyRight>
- <P1JoyDown>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyDown>
- <P1JoyLeft>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyLeft>
- <P1B1>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B1>
- <P1B2>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B2>
- <P1B3>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B3>
- <P1B4>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B4>
- <P1B5>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B5>
- <P1B6>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B6>
- <P1B7>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B7>
- <P1B8>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B8>
- <P2JoyUp>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyUp>
- <P2JoyRight>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyRight>
- <P2JoyDown>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyDown>
- <P2JoyLeft>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyLeft>
- <P2B1>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B1>
- <P2B2>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B2>
- <P2B3>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B3>
- <P2B4>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B4>
- <P2B5>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B5>
- <P2B6>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<ForeColor>Color [White]</ForeColor>
<Visible>False</Visible>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B6>
- <P2B7>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B7>
- <P2B8>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B8>
- <P1JoyType>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyType>
- <P2JoyType>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyType>
- <GameName>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</GameName>
- <NumPlayers>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</NumPlayers>
- <History>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</History>
- <Undocumented>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</Undocumented>
- <MainForm>
<Width>640</Width>
<Height>480</Height>
<Background>C:\CPViewer\BackgroundImage.jpg</Background>
</MainForm>
</CPViewer>
Now I want to be able to read it back in when I choose the xml file in my
openfiledialog box. It should then apply all of the settings in the xml
file. Get me started here. Give me some advice on how to start.
Thanks,
John
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi John,
You mean something as this
\\\
Dim label1fontcolor As String = Me.Label1.ForeColor.ToString
Dim label1font As String = Me.Label1.Font.ToString
Dim label1backcolor As String = Me.Label1.BackColor.ToString
///
You have to extract them of course to use them again, have as well a look
at the split for that.
I saw in other messages you are not using the background image as set in
the resource so I assume that is just saving the path.
I hope this helps?
Cor
Cor....That's better. It seems to work now. Here is my code:
<...> Now, how am I going to handle writing out the fore color, back color and
font of the labels and the background image of the form? This was the part
that gave me trouble before. Keep it simple, I'm a n00b.