Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8648675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:22:06+00:00 2026-06-12T13:22:06+00:00

I need to have my button disabled while dzien=0 , and enabled while dzien

  • 0

I need to have my button disabled while dzien=0, and enabled while dzien >0.

When I launch the application, it doesn’t matter if day is 0 or 102938129038, button is still disabled. What’s wrong with my code?

Imports System.IO.IsolatedStorage
Partial Public Class Page1
Inherits PhoneApplicationPage
Private dzien As Integer
Public Sub New()
    InitializeComponent()
End Sub

Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
    IsolatedStorageSettings.ApplicationSettings("dzien") = dzien
    Try
        dzien = CInt(IsolatedStorageSettings.ApplicationSettings("dzien"))
    Catch ex As KeyNotFoundException
        dzien = 0
    End Try
    If dzien = 0 Then
        dzien = dzien + 1
    End If
    NavigationService.Navigate(New Uri("/2.xaml", UriKind.Relative))
End Sub
Private Sub Class_1_loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    If dzien = 0 Then
        Button2.IsEnabled = False
    Else
        Button2.IsEnabled = True
    End If

End Sub
Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click

    dzien = dzien + 1

    NavigationService.Navigate(New Uri("/2.xaml", UriKind.Relative))
End Sub
End Class

I’m not sure if

If dzien = 0 Then
    dzien = dzien + 1
End If

works well
and

dzien = dzien + 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:22:07+00:00Added an answer on June 12, 2026 at 1:22 pm
    Private Sub Class_1_loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    If dzien = 0 Then
       Button2.Enabled = False
    Else 
       Button2.Enabled = True
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Button on appwidget, that I need to 'enable'/'disable' programmatically from a
OK, I have two HTML select elements and a button. I need to disable
I need to have a button whose text is underlined and the only way
I need to have only one button in showConfirmDialog . I tried this: int
I have a button,Linkbutton and an ModalPopup. If I click button1 I need to
I have a button called as Sync . On clicking on it, I need
I have a hidden button on a form that I need to click in
i have a form button in the form,which i need to perform basic action
I have a Flex button. I need one color on the left and another
I need some advanced CSS help here. I have a login button and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.