Re: My.Settings Questions
- From: Mike <unknown@xxxxxxxxxx>
- Date: Fri, 05 Jun 2009 16:29:15 -0400
Yes, I finally figured it out after playing with ConfigurationManager and RoamingUserANdLocal stuff to get the application user.config. I ended up not needed it but it lead me to what you are saying.
The user.config will contain a userSettings for the EXE and DLL. Duplicated it but the ended just the one in the DLL since it is self contained and used properties to all the EXE to setup if it needs too.
thanks for your input
--
Michel Posseth [MCP] wrote:
Hello Mike.
You do not need to pass a my.settings instance to the constructor
you can just use the common my.settings fields inside your class
as the settings are used from the calling assembly
So you define the same properties in both projects but during runtime the farmework automaticly uses the properties from the calling assembly ( the exe ) in fact you need to perfom some extra coding if you want to use the setting stored in the config from the called assembly ( the dll )
HTH
Michel Posseth
"Mike" <unknown@xxxxxxxxxx> schreef in bericht news:es4TJeb5JHA.3860@xxxxxxxxxxxxxxxxxxxxxxxI never really used VB6 at this level.
Overall, I have
Project.EXE
ControlLibrary.DLL
There is a FORM in the library. I need to make the DLL use the Application My.Settings.
--
Cor Ligthert[MVP] wrote:Mike,
The my.Settings is build to make a bridge between VB6 users and Net
It works like VB6
Cor
"Mike" <unknown@xxxxxxxxxx> wrote in message news:OPoC8Ea5JHA.6136@xxxxxxxxxxxxxxxxxxxxxxxI 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
--
- References:
- My.Settings Questions
- From: Mike
- Re: My.Settings Questions
- From: Cor Ligthert[MVP]
- Re: My.Settings Questions
- From: Mike
- Re: My.Settings Questions
- From: Michel Posseth [MCP]
- My.Settings Questions
- Prev by Date: Re: My.Settings Questions
- Next by Date: Re: Application Icon Setting in project
- Previous by thread: Re: My.Settings Questions
- Next by thread: Re: My.Settings Questions
- Index(es):
Relevant Pages
|