StrataFrame Forum

How to avoid that MainScreen is closed when Session Lock

http://forum.strataframe.net/Topic20857.aspx

By Rainer Kempf, RK - 11/23/2008

Hello,



How can i avoid that Main-Screen is closed(hidden) when Session locks ?



I was searching around but can't find a Solution.



Also would be interessting to know how do display Exit button (in Loggin Form) for Re-Login.



thanks



Rainer


By Edhy Rijo - 11/23/2008

Hi Rainer,

How can i avoid that Main-Screen is closed(hidden) when Session locks ?

I really don't know, but that is the purpose of Session Lock feature, to lock out the application until a valid user gets access to it again.

Also would be interesting to know how do display Exit button (in Loggin Form) for Re-Login

For that you will have to create your own Login form, which is very easy to do (see documentation) and add that functionality.  Keep in mind that Session Lock will leave forms in their current state (ex: unsaved data, etc.) so you may also check for those things before closing any open form.  There has been a couple of discussion about this in the forum, so search for the "Session Lock".

By Rainer Kempf, RK - 11/24/2008

Hi Edhy,



Thank you for your anwser.



After i placed my question here in Forum, i tried out

some other thing, and now i got it working as i want.





thanks



Rainer
By Edhy Rijo - 11/24/2008

Hi Rainer,

I am glad you got it working. 

Would you mind sharing with us what you did?

By Rainer Kempf, RK - 12/3/2008

Hi Edhy



yes of course



I did following :



In AppMain.Vb







Private Shared Sub ShowLoginAndInitMainForm(ByVal e As ShowLoginAndInitFormEventArgs)



e.ShowMainForm = True





End Sub







and in the mainform i do something like







Private Sub MKSBaseAppWithSecurity_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load



Me.Visible = False

Dim ll_success_login As Boolean = False





Login.LoginFormType = GetType(MKSBaseLoginForm)



#If DEBUG Then

Login.SetLoggedInUser("supervisor", "mks", "")

ll_success_login = True

#Else

ll_success_login = Login.ShowLoginAndAuthUser(True)

#End If







If ll_success_login Then

then do something like enable all controls

Else

then do something like disable all controls

End If





Me.Visible = True



End Sub







that all

and it works fine....



Rainer