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
ovenstående er kun når man skriver i programmets eget vindues
hvis man skal læse alle key strokes så skal man over i noget helt andet
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.