M
Mike
I just started using My.Settings in my VB.NET project. I think its
really cool the way the IDE allows you create it, etc.
I have an implementation question:
I haved this:
- general LoginForm in a class library (DLL)
- A multi-user application (EXE)
Application is run from a share drive, each user
has its own credentials he can save on his PC.
Overall, what is recommended approach use MySettings here from the
standpoint of passing and/or where the form will initialize its fields?
The form has:
UserName:
Password:
[_] Remember Credentials
[_] Auto Login
(_) Use Local Server
(_) Pick Server
(_) Use this server ________________
The question is this:
Should the EXE has the My.Settings and prepare the login form before
doing a ShowDialog or can I do this in the Loginform class Load event
by passing My.Settings to the constructor?
For example:
Public Class LoginForm
Public UserSettings As My.Settings
Private Sub LoginForm_Load( _
ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
chkRemember.Checked = UserSettings.UseRemember <-- invalid
chkAutoLogin.Checked = UserSettings.UseAutoLogin <-- invalid
etc
...
End Sub
End Class
The problem is that compiler issues the error:
error BC30909: 'UserSettings' cannot expose type 'My.MySettings'
outside the project through class 'LoginForm'.
Of course, I can do this outside the form or maybe use properties from
outside the form.
Is that the way or is there another method?
Thanks
--
really cool the way the IDE allows you create it, etc.
I have an implementation question:
I haved this:
- general LoginForm in a class library (DLL)
- A multi-user application (EXE)
Application is run from a share drive, each user
has its own credentials he can save on his PC.
Overall, what is recommended approach use MySettings here from the
standpoint of passing and/or where the form will initialize its fields?
The form has:
UserName:
Password:
[_] Remember Credentials
[_] Auto Login
(_) Use Local Server
(_) Pick Server
(_) Use this server ________________
The question is this:
Should the EXE has the My.Settings and prepare the login form before
doing a ShowDialog or can I do this in the Loginform class Load event
by passing My.Settings to the constructor?
For example:
Public Class LoginForm
Public UserSettings As My.Settings
Private Sub LoginForm_Load( _
ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
chkRemember.Checked = UserSettings.UseRemember <-- invalid
chkAutoLogin.Checked = UserSettings.UseAutoLogin <-- invalid
etc
...
End Sub
End Class
The problem is that compiler issues the error:
error BC30909: 'UserSettings' cannot expose type 'My.MySettings'
outside the project through class 'LoginForm'.
Of course, I can do this outside the form or maybe use properties from
outside the form.
Is that the way or is there another method?
Thanks
--