Re: My.Settings Questions
- From: "Michel Posseth [MCP]" <MSDN@xxxxxxxxxxx>
- Date: Fri, 5 Jun 2009 17:16:40 +0200
The my.Settings is build to make a bridge between VB6 users and Net
It works like VB6
:-| Huh ???? ,,,,, well then i sure missed something in VB6 and also the
writers of the core reference guide of VB6 as
there is nothing stated in there ( just checked to be sure ) about something
that is even close to the my.settings namespace
This is what MSFT tells about the My namespace
My Namespace
The My namespace in Visual Basic exposes properties and methods that enable
you to easily take advantage of the power of the .NET Framework. The My
namespace simplifies common programming problems, often reducing a difficult
task to a single line of code. Additionally, the My namespace is fully
extensible so that you can customize the behavior of My and add new services
to its hierarchy to adapt to specific application needs.
So the my namespace is just a collection of shortcuts in the .Net framework
wich is extensible to your own needs and has nothing to do what so ever
with VB legacy a VB legacy coder would not even know what you are talking
about if you would confront him with "My.Settings"
HTH
Michel
"Cor Ligthert[MVP]" <Notmyfirstname@xxxxxxxxx> schreef in bericht
news:%23uQVxDb5JHA.1420@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
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
--
.
- Follow-Ups:
- Re: My.Settings Questions
- From: Cor Ligthert[MVP]
- Re: My.Settings Questions
- References:
- My.Settings Questions
- From: Mike
- Re: My.Settings Questions
- From: Cor Ligthert[MVP]
- My.Settings Questions
- Prev by Date: Re: GotFocus event never fires for form
- Next by Date: Re: Writing a file in Response
- Previous by thread: Re: My.Settings Questions
- Next by thread: Re: My.Settings Questions
- Index(es):
Relevant Pages
|