I have a simple WPF vb.net application and wish to set the visibility property of some buttons on the main window to True when user successfully logs on
I have a MainWindow window with a frame hosting any number of pages and use the navigation service to load into this frame eg. Me.BodyFrame.Navigate(New System.Uri("Logon.xaml", UriKind.Relative))
One Page (logon) enables user to logon.
vb.net code:
Dim txtLocalLogonID = txtLogonID.Text
Dim pwdLocalPassword = pwdPassword.Password
Dim LocalLogon As New gblLogon()
Dim LocalLogonSuccessInd = LocalLogon.ValidateLogon(txtLocalLogonID, pwdLocalPassword)
If LocalLogonSuccessInd = True Then
MessageBox.Show
I have a simple WPF vb.net application and wish to set the visibility property of some buttons on the main window to True when user successfully logs on
I have a MainWindow window with a frame hosting any number of pages and use the navigation service to load into this frame eg.
Me.BodyFrame.Navigate(New System.Uri("Logon.xaml", UriKind.Relative))
One Page (logon) enables user to logon.
vb.net code:
Dim txtLocalLogonID = txtLogonID.Text
Dim pwdLocalPassword = pwdPassword.Password
Dim LocalLogon As New gblLogon()
Dim LocalLogonSuccessInd = LocalLogon.ValidateLogon(txtLocalLogonID, pwdLocalPassword)
If LocalLogonSuccessInd = True Then
MessageBox.Show("Successful")
Application.LogonParam.txtLogonID = txtLocalLogonID
In the MainWindow vb.net code:
Public Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
Me.lblLogonID.Content = Application.LogonParam.txtLogonID
If Application.LogonParam.txtLogonID = "guest" Then
Me.btnLocalSupplies.Visibility = 0
Me.btnLocalSuppliesL.Visibility = 0
Me.btnAds.Visibility = 0
Me.btnAds.Visibility = 0
Else
Me.btnLocalSupplies.Visibility = 1
Me.btnLocalSuppliesL.Visibility = 1
Me.btnAds.Visibility = 1
Me.btnAds.Visibility = 1
End If
End Sub
How do I reload the main window? I realise the code is primitive but I just want to get it working first.