Hi Edneeis,
Everything else works fine
I am doing something wrong here:
The following is in my app.Config
When the Form loads, I expect the Form to do this: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)" />
VB Code:
Me.Left = AppSettingsManager.LoadAndGetValue("WindowLeft") Me.Top = AppSettingsManager.LoadAndGetValue("WindowTop")
But I am not getting the expected result and I get the following error instead:
Hope you released what I was going to do.Additional information: Cast from string "((System.Windows.Forms.Screen.Pr" to type 'Integer' is not valid.
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" />





Reply With Quote