1. Home
  2. /
  3. Vbnet
  4. /
  5. VB.NET Counter and Theme Toggle

VB.NET Counter and Theme Toggle - Vbnet Typing CST Test

Loading…

VB.NET Counter and Theme Toggle — Vbnet Code

Demonstrates a simple counter with theme toggling using VB.NET variables and console output.

Module Program
	Dim count As Integer = 0
	Dim isDark As Boolean = False

	Sub UpdateUI()
		Console.WriteLine($"Counter: {count}")
		Console.WriteLine($"Theme: {(If(isDark, "Dark", "Light"))}")
	End Sub

	Sub Increment()
		count += 1
		UpdateUI()
	End Sub

	Sub Decrement()
		count -= 1
		UpdateUI()
	End Sub

	Sub ResetCounter()
		count = 0
		UpdateUI()
	End Sub

	Sub ToggleTheme()
		isDark = Not isDark
		UpdateUI()
	End Sub

	Sub Main()
		' Simulate actions
		UpdateUI()
		Increment()
		Increment()
		ToggleTheme()
		Decrement()
		ResetCounter()
	End Sub
End Module

Vbnet Language Guide

VB.NET (Visual Basic .NET) is an object-oriented, event-driven programming language on the .NET platform. It is designed for rapid application development, supporting Windows applications, web services, desktop apps, and enterprise software. It emphasizes readability and simplicity while leveraging the full .NET framework.

Primary Use Cases

  • ▸Windows desktop applications (WinForms, WPF)
  • ▸ASP.NET web applications
  • ▸Enterprise internal tools
  • ▸Automated business logic & workflows
  • ▸Integration with SQL Server & other databases
  • ▸.NET libraries and API development

Notable Features

  • ▸Full .NET framework integration
  • ▸Readable, English-like syntax
  • ▸Rapid Application Development (RAD) support
  • ▸Strongly typed with optional late binding
  • ▸Event-driven programming model

Origin & Creator

Created by Microsoft, VB.NET was introduced in 2002 as a successor to classic Visual Basic, fully integrating with the .NET Framework.

Industrial Note

VB.NET is widely used in enterprise software, internal business applications, legacy systems modernization, and rapid Windows application development.

More Vbnet Typing Exercises

VB.NET Simple CalculatorVB.NET FactorialVB.NET Fibonacci SequenceVB.NET Array ComprehensionVB.NET Dictionary FilteringVB.NET Anonymous FunctionsVB.NET Sum of ArrayVB.NET Zip ArraysVB.NET Tuple Destructuring

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher