C
Chuck
I want to save the location of my forms when they are closed.
I was thinking of using: UserScopedSettingAttribute class
http://msdn2.microsoft.com/en-us/library/zz7y4375(VS.80).aspx
Had three questions
1.
What's the difference between [UserScopedSetting()] and
[UserScopedSettingAttribute()]
2.
Is there anyway I could incorporate this in my baseForm class and then
override the OnClosing to save the form location for every form that
is inherited from my class. I wasn't sure if I could because it looks
like the UserScopedSettingAttribute class saves the data to a file
user.config:
<userSettings>
<WindowsApplication1.ClassName>
So every form would try to save to the same place (appName.ClassName).
3.
How can I ensure that when I restore a form to the saved form location
the location is still valid/visible. For example I have a two monitor
display with display 2 on the left.
Thus with display 2 and a form in the top left the form.location would
be -1024,0 (If display 2 was on the right the location would be 0,0)
If the user changes the display so 2 is now on the right my
application would try to display it at -1024 which would now be off of
the screen. Is there anyway to test that a location is within the
viewable area?
This happens, I've had applications that I can't get at anymore after
I swapped monitors.
thanks,
I was thinking of using: UserScopedSettingAttribute class
http://msdn2.microsoft.com/en-us/library/zz7y4375(VS.80).aspx
Had three questions
1.
What's the difference between [UserScopedSetting()] and
[UserScopedSettingAttribute()]
2.
Is there anyway I could incorporate this in my baseForm class and then
override the OnClosing to save the form location for every form that
is inherited from my class. I wasn't sure if I could because it looks
like the UserScopedSettingAttribute class saves the data to a file
user.config:
<userSettings>
<WindowsApplication1.ClassName>
So every form would try to save to the same place (appName.ClassName).
3.
How can I ensure that when I restore a form to the saved form location
the location is still valid/visible. For example I have a two monitor
display with display 2 on the left.
Thus with display 2 and a form in the top left the form.location would
be -1024,0 (If display 2 was on the right the location would be 0,0)
If the user changes the display so 2 is now on the right my
application would try to display it at -1024 which would now be off of
the screen. Is there anyway to test that a location is within the
viewable area?
This happens, I've had applications that I can't get at anymore after
I swapped monitors.
thanks,