Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Module Module1
Sub Main()
For i = 0 To 255
Select Case i
Case 9
Console.Write("9 : \T")
Case 10
Console.Write("10 : \N")
Case 13
Public Class Form1
' Form controls: TextBox TextBox1, Label Label1
Private opt As Integer
Private names(9) As String
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
names = {"Andrew", "Brian", "Charles", "David", "Edward", "Finn", "George", "Harry", "Ian", "John"}
TextBox1.Focus()
End Sub
Public Class Form1
' Form Controls: Button BtnRed, Button BtnAmber, Button BtnGreen, TextBox TbxActor
Private Sub BtnRed_Click(sender As System.Object, e As System.EventArgs) Handles BtnRed.Click
TbxActor.BackColor = Color.Red
TbxActor.Text = "RED"
End Sub
Private Sub BtnAmber_Click(sender As System.Object, e As System.EventArgs) Handles BtnAmber.Click
TbxActor.BackColor = Color.Gold
Public Class Form1
' Form controls: Label Label1, TextBox TxtLimit, Button BtnExe, ListBox LstItems, Label LblInfo
Dim r As Random
Dim l, s, t As Integer
Dim z As Date
Private Sub BtnExe_Click(sender As System.Object, e As System.EventArgs) Handles BtnExe.Click
z = Date.UtcNow()
LblInfo.Text = "Running..."
Public Class Form1
' Form Controls: Label Label1, TextBox TextBox1, Button Button1, Button Button2, Label Label2
Private output As Integer
Private Sub CalculateProc(n As Integer)
output = n * 2
End Sub
Private Function CalculateFn(n As Integer) As Integer
Public Class Form1
' Form Controls: Label LblContext, TextBox TbxInput, Button BtnSubmit
Dim _name As String = vbNull
Private Sub BtnSubmit_Click(sender As System.Object, e As System.EventArgs) Handles BtnSubmit.Click
If TbxInput.Text <> _name Then
If TbxInput.Text = "" Then
TbxInput.BackColor = Color.Yellow
MessageBox.Show("Please enter your name in the provided box", Application.ProductName)
Public Class Form1
' Form Controls: Button BtnPush, ListBox LstOutput
Dim r As Random
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
r = New Random()
End Sub
Private Sub BtnPush_Click(sender As System.Object, e As System.EventArgs) Handles BtnPush.Click
Public Class Form1
' Form Controls: TextBox TxtLower, TextBox TxtLimit, Button BtnExe, ListBox LstItems
Private Sub BtnExe_Click(sender As System.Object, e As System.EventArgs) Handles BtnExe.Click
Try
Dim l0 As Integer = CInt(TxtLower.Text)
Dim l1 As Integer = CInt(TxtLimit.Text)
LstItems.Items.Clear()
For i As Integer = l0 To l1
LstItems.Items.Add(i)
Module Module1
Dim x, y As Integer
Dim k As ConsoleKeyInfo
Sub Main()
x = 0
y = 0
Console.SetCursorPosition(x, y)
Do
Console.Clear()
Console.SetCursorPosition(0, Console.WindowHeight - 2)
Public Class Form1
' Form Controls: Label Label1, TextBox TxtLimit, Button BtnExe, ListBox LstItems, Label LblInfo
Dim rand As Random
Dim count, coins, flip, tails As Integer
Dim result() As String
Dim done As Boolean
Dim z As Date
Dim o As String