Click here to Skip to main content
15,888,212 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Private Sub PictureBox7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox7.Click
        PictureBox7.Hide()
        PictureBox6.Hide()
        PictureBox5.Show()
        Dim readValue As String
        readValue = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\ARSS", "EPV", Nothing)
        If readValue <> "" Then
            Button1.Hide()
            ConfigurationMain.TabPages.Remove(TabPage2)
            ConfigurationMain.TabPages.Remove(TabPage4)
            Savemain.Hide()
            Label23.Hide()
            Login.Show()
        Else
            Button1.Show()
            ConfigurationMain.TabPages.Remove(TabPage2)
            ConfigurationMain.TabPages.Remove(TabPage4)
            Login.Hide()
            Savemain.Show()
            Label23.Hide()
            Timer1.Interval = 100
            Timer1.Enabled = True
        End If
    End Sub
Posted

1 solution

Hi, make something like that:

VB
Dim readValue As String
readValue = CStr(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\ARSS", "EPV", Nothing))

If Not String.IsNullOrEmpty(readValue) Then
    '....
End If



And one advice, set the project option 'strict' to 'on' - then you should get an error at compile time.
 
Share this answer
 
Comments
F. Xaver 19-Sep-13 10:28am    
You give something to readValue, so it wouldn't display a error, even with 'strict on'
just use
readValue = CStr(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\ARSS", "EPV", ""))
instead ^^
so even 'If readValue <> "" Then' would work

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