2 replies
by vikfrank Accepted solution
by tony hopkinson Accepted solution
You child forme get the logic surrounding username and password, because they all have the same paranet class. However when you instantiate one ( create it) they get their 'own copy' of those properties which obviously haven't been set.
There are few ways of getting what you want, the simplest is to add a constructor which takes user name an password as a parameters and then use it to create all the child forms.
Personally however I'd tuck all the username and password (login log out etc) in it's own class and then either access that through a singleton pattern (google singleton vb.net). Or again add a constructor to the parent form that took the 'user' class.
Key questions to ask yourself are
Should an unauthorised user be able to even access the form.
Can you have more than one form up at once, and if so are they all having their own login session. do you want to pass the login between forms and last but not least are you happy with password being so readily available cross all your code. I wouldn't be.
This discussion is closed to new replies.
Trending Software posts
Sort by Trending