Form.Shown and CurrentPrincipal

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

Hello,

In the Form.Shown event (startup form), I set My.User.CurrentPrincipal
with a GenericPrincipal.
But My.User.CurrentPrincipal doesn't keep this information.
If I do the same in a Button click event on the form, it's OK.

Do you know why ?
 
Dans : Fred écrivait :
Hello,

In the Form.Shown event (startup form), I set My.User.CurrentPrincipal
with a GenericPrincipal.
But My.User.CurrentPrincipal doesn't keep this information.
If I do the same in a Button click event on the form, it's OK.

Do you know why ?

If I start a timer (the component) and set the CurrentPrincipal in the
Tick handler it's OK.
If I use a System.Threading.Timer, it doesn't work (I use Delegates to
invoke the proc where I set the CurrentPrincipal on the form thread)
I guess it has something to do with threads but I can't figure out what.
 
Back
Top