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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:40:34+00:00 2026-05-31T19:40:34+00:00

Module Module1 Public cccounter = 9 End Module Public Class frmNim Private Sub btnSelect_Click(sender

  • 0
Module Module1
    Public cccounter = 9
End Module

Public Class frmNim

    Private Sub btnSelect_Click(sender As System.Object, e As System.EventArgs) Handles btnSelect.Click
        MsgBox(cccounter)
    End Sub

End Class

Why does this generate errors? I can’t figure out any other way to make a simple counter go up by clicking on a button. This is frustrating me to no end. Is there something very simple that I’m obviously missing?

  • 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-31T19:40:35+00:00Added an answer on May 31, 2026 at 7:40 pm

    Use MessageBox.Show(ccounter)

    I think you’re using the old VB6 coding. This won’t work in VB.NET.

    MSDN

    If you need your counter to go up, you do need an extra line of code:

    ccounter += 1
    

    EDIT:

    Missed the declaration in the module (VB.Net bit rusty now a days)

    You should declare the ccounter as a variable as mentioned by @Eddie Paz)
    I’ve made a quick sample that adds 1 at every click on the button.

    Module Module1
        Public ccounter As Integer = 9
    End Module
    
    
    Public Class Form1
    
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            ccounter += 1
            MessageBox.Show(ccounter)
        End Sub
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imports System.Reflection Public Class Test Private Field As String End Class Module Module1 Sub
I have a program like this. Module Module1 Public Class Mstr Public Property Prop1
public class Module { // required instance variables private String codeModule, titleModule; private int
Reproduction: Imports System.ComponentModel Imports System.ComponentModel.DataAnnotations Module Module1 Sub Main() Dim type = GetType(Contact) TypeDescriptor.AddProviderTransparent(
<?php class PI_Controller_Plugin_AssetGrabber extends Zend_Controller_Plugin_Abstract { public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) { /* The module
I have the following module public class LowerCaseRequest : IHttpModule { public void Init(HttpApplication
GIN Module: public class InjectorModule extends AbstractGinModule { @Override protected void configure() { bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
I have realized my module system by forcing modules to implement an abstract class,
Module Module1 Public Declare Function GET_CALCULATION_FAN_ALONE Lib EbmPapstFan.dll (ByRef path As String) As Long
In server side I have following class public class EditorContext { public Module Module

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.