Hello Se3ker,
I cannot understand the requirement clearly, so I want to clarify it with you.
Do you mean when My.Settings.IsAuthenticated is True, the form title should be changed to "Logged in as: XXX", when it is false, the title should be "Guest"? I think you don't need to handle the "SettingsLoaded" event, just put these code into Main_Load method is ok.
Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Settings.IsAuthenticated Then
Main.LblUser.Caption = "Logged in as: " & My.Settings.Username
Else
Main.LblUser.Caption = "Guest"
End If
End Sub
>Is there a way to call the above code in the Load event without using the IF ENDIF statements, it basically just needs to load a setting. When it is loaded the other code will run?? What I confused was the above question. Could you please explain it clearly?
Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the
All-In-One Code Framework!