Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
VB
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:
VB
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:
VB
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.
Posted
Updated 16-Aug-10 2:25am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900