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 6917383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:43:24+00:00 2026-05-27T09:43:24+00:00

https://i.stack.imgur.com/ZxpaP.png ‘InitializeComponent’ is not declared. It may be inaccessible due to its protection level.

  • 0

https://i.stack.imgur.com/ZxpaP.png

‘InitializeComponent’ is not declared. It may be inaccessible due to its protection level.

https://i.stack.imgur.com/na20Z.png

‘CountTextBlock’ is not a member of ‘Tally.Tally.MainPage’.

I have no idea why i am getting these errors. Please check the links for images of the errors. I have converted the code from c# to Vb.net using many converters. All of them gives the same conversion.

Code :-

Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Navigation
Imports Microsoft.Phone.Controls
Imports Tally.WindowsPhoneApp ' For the Setting class



Namespace Tally
    Partial Public Class MainPage
        Inherits PhoneApplicationPage
        Private count As Integer = 0
        ' Remember what the user typed, for future app activations or launches:
        Private savedCount As New Setting(Of Integer)("SavedCount", 0)

        Public Sub New()
            InitializeComponent()
        End Sub

        ' Handle a tap anywhere on the page (other than the Button)
        Protected Overrides Sub OnMouseLeftButtonDown(ByVal e As MouseButtonEventArgs)
            MyBase.OnMouseLeftButtonDown(e)
            Me.count += 1
            Me.CountTextBlock.Text = Me.count.ToString("N0")
        End Sub

        ' Handle a tap on the button
        Private Sub ResetButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
            Me.count = 0
            Me.CountTextBlock.Text = Me.count.ToString("N0")
        End Sub

        Protected Overrides Sub OnNavigatedFrom(ByVal e As NavigationEventArgs)
            MyBase.OnNavigatedFrom(e)
            ' Persist state when leaving for any reason (Deactivated or Closing):
            Me.savedCount.Value = Me.count
        End Sub

        Protected Overrides Sub OnNavigatedTo(ByVal e As NavigationEventArgs)
            MyBase.OnNavigatedTo(e)
            ' Restore persisted state:
            Me.count = Me.savedCount.Value
            Me.CountTextBlock.Text = Me.count.ToString("N0")
        End Sub
    End Class
End Namespace

Settings.vb

Imports System.IO.IsolatedStorage
Namespace WindowsPhoneApp
    ' Encapsulates a key/value pair stored in Isolated Storage ApplicationSettings
    Public Class Setting(Of T)
        Private name As String
        'INSTANT VB NOTE: The variable value was renamed since Visual Basic does not allow class members with the same name:
        Private value_Renamed As T
        'INSTANT VB NOTE: The variable defaultValue was renamed since Visual Basic does not allow class members with the same name:
        Private defaultValue_Renamed As T
        Private hasValue As Boolean
        Public Sub New(ByVal name As String, ByVal defaultValue As T)
            Me.name = name
            Me.defaultValue_Renamed = defaultValue
        End Sub
        Public Property Value() As T
            Get
                ' Check for the cached value
                If Not Me.hasValue Then
                    ' Try to get the value from Isolated Storage
                    If Not IsolatedStorageSettings.ApplicationSettings.TryGetValue(Me.name, Me.value_Renamed) Then
                        ' It hasn’t been set yet
                        Me.value_Renamed = Me.defaultValue_Renamed
                        IsolatedStorageSettings.ApplicationSettings(Me.name) = Me.value_Renamed
                    End If
                    Me.hasValue = True
                End If

                Return Me.value_Renamed
            End Get
            Set(ByVal value As T)
                ' Save the value to Isolated Storage
                IsolatedStorageSettings.ApplicationSettings(Me.name) = value
                Me.value_Renamed = value
                Me.hasValue = True
            End Set
        End Property
        Public ReadOnly Property DefaultValue() As T
            Get
                Return Me.defaultValue_Renamed
            End Get
        End Property
        ' "Clear" cached value:
        Public Sub ForceRefresh()
            Me.hasValue = False
        End Sub
    End Class
End Namespace
  • 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-05-27T09:43:25+00:00Added an answer on May 27, 2026 at 9:43 am

    Try creating new pages in your project first via the built-in Visual Studio facilities, then copy and paste your translated code on top of the auto-generated code.

    I believe the problem is that you’re missing the rest of the .designer.vb code files that are normally auto-generated when you’re creating these pages by hand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(This question could be better off on math, but im not sure) https://i.stack.imgur.com/ujPJG.png This
Error: Link since you cant make the image bigger when its embeded: https://i.stack.imgur.com/WhUCp.png I
I have a plot like this: https://i.stack.imgur.com/zdike.png I need the data coordinates of points
Here is a screenshot of what I'm working with at the moment... https://i.stack.imgur.com/45GX9.png The
I have this kind of pattern https://i.stack.imgur.com/PT6WL.png in big part of PSD, and how
I have two grayscale Png files( https://i.stack.imgur.com/8RGh4.jpg ) that I want consider as a
I have a html document that has this structure: https://i.stack.imgur.com/zrOq1.png <- sorry for link,
I want to create a DashBoard in my Application like that https://i.stack.imgur.com/uDwlf.png . The
https://i.stack.imgur.com/SEFNd.png I'm new to HTML5 so my code is likely to be messy, I'm
i have this simplified Model: https://i.stack.imgur.com/d2WsV.png I have these Elements ordered in an NSOutlineView

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.