' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Drawing
Imports System.Windows.Forms

Namespace E
    Public Class MainForm
    Inherits Form
        Private textBox1 As TextBox
        Public Sub New()
            InitializeComponent
        End Sub
        <STAThread()> _
        Public Shared Sub Main(ByVal args As String())
            Application.Run(New MainForm)
        End Sub
        Private Sub InitializeComponent()
            textBox1 = New TextBox
            SuspendLayout
            textBox1.Location = New Point(25, 25)
            textBox1.Multiline = True
            textBox1.Size = New Size(150, 150)
            textBox1.Text = ""
            AddHandler textBox1.KeyDown, AddressOf TextBox1KeyDown
            ClientSize = New Size(200, 200)
            Controls.Add(textBox1)
            Text = "Test"
            ResumeLayout(False)
        End Sub
        Sub TextBox1KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
            If e.KeyCode = Keys.A AndAlso e.Shift Then
                MessageBox.Show("stort A")
            Else
                If e.KeyCode = Keys.A AndAlso Not e.Shift Then
                    MessageBox.Show("lille a")
                End If
            End If
        End Sub
    End Class 
End Namespace
