Hi Edneeis,

Everything else works fine

I am doing something wrong here:

The following is in my app.Config
PHP Code:
<add key="WindowLeft" value="((System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - Me.Width) / 2)" />
<
add key="WindowTop" value="((System.Windows.Forms.Screen.PrimaryScreen.Bounds.width - Me.height) / 2)" /> 
When the Form loads, I expect the Form to do this:

VB Code:
  1. Me.Left = AppSettingsManager.LoadAndGetValue("WindowLeft")
  2.         Me.Top = AppSettingsManager.LoadAndGetValue("WindowTop")

But I am not getting the expected result and I get the following error instead:

Additional information: Cast from string "((System.Windows.Forms.Screen.Pr" to type 'Integer' is not valid.
Hope you released what I was going to do.
Is it possible to pass this kind of information from the XML file to the Form at Form_Load?

Thank you,
McoreD

P.S: It works perfectly if I replace the XML code with (using numbers):
For example:

PHP Code:
<add key="WindowLeft" value="500" />
<
add key="WindowTop" value="500" />