diff --git a/ApplicationEvents.vb b/ApplicationEvents.vb new file mode 100644 index 0000000..cf403a0 --- /dev/null +++ b/ApplicationEvents.vb @@ -0,0 +1,29 @@ +Imports Microsoft.VisualBasic.ApplicationServices + +Namespace My + ' The following events are available for MyApplication: + ' Startup: Raised when the application starts, before the startup form is created. + ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. + ' UnhandledException: Raised if the application encounters an unhandled exception. + ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. + ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. + + ' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. + + ' Example: + ' Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults + ' + ' ' Setting the application-wide default Font: + ' e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) + ' + ' ' Setting the HighDpiMode for the Application: + ' e.HighDpiMode = HighDpiMode.PerMonitorV2 + ' + ' ' If a splash dialog is used, this sets the minimum display time: + ' e.MinimumSplashScreenDisplayTime = 4000 + ' End Sub + + Partial Friend Class MyApplication + + End Class +End Namespace diff --git a/Das kleine Ein mal Eins.sln b/Das kleine Ein mal Eins.sln new file mode 100644 index 0000000..d1b2727 --- /dev/null +++ b/Das kleine Ein mal Eins.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32526.322 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Das kleine Ein mal Eins", "Das kleine Ein mal Eins.vbproj", "{83C9FB4B-1E30-4F0A-9FCF-A0CFC5EEAF20}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {83C9FB4B-1E30-4F0A-9FCF-A0CFC5EEAF20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {83C9FB4B-1E30-4F0A-9FCF-A0CFC5EEAF20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83C9FB4B-1E30-4F0A-9FCF-A0CFC5EEAF20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83C9FB4B-1E30-4F0A-9FCF-A0CFC5EEAF20}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E868F55E-33D7-487D-AD0A-6F3CC4A43B18} + EndGlobalSection +EndGlobal diff --git a/Das kleine Ein mal Eins.vbproj b/Das kleine Ein mal Eins.vbproj new file mode 100644 index 0000000..638726e --- /dev/null +++ b/Das kleine Ein mal Eins.vbproj @@ -0,0 +1,33 @@ + + + + WinExe + net6.0-windows + Das_kleine_Ein_mal_Eins + Sub Main + true + WindowsForms + + + + + + + + + + + True + True + Application.myapp + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + \ No newline at end of file diff --git a/Form1.Designer.vb b/Form1.Designer.vb new file mode 100644 index 0000000..093a2ca --- /dev/null +++ b/Form1.Designer.vb @@ -0,0 +1,157 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Windows Form-Designer benötigt. + Private components As System.ComponentModel.IContainer + + 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. + 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. + 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. + _ + Private Sub InitializeComponent() + Me.Label1 = New System.Windows.Forms.Label + Me.Button1 = New System.Windows.Forms.Button + Me.Button2 = New System.Windows.Forms.Button + Me.TextBox1 = New System.Windows.Forms.TextBox + Me.Label2 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label1.Location = New System.Drawing.Point(13, 13) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(158, 24) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Das kleine 1 x 1" + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(17, 144) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(123, 23) + Me.Button1.TabIndex = 1 + Me.Button1.Text = "Neue Zahlen ..." + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(174, 144) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 2 + Me.Button2.Text = "Test!" + Me.Button2.UseVisualStyleBackColor = True + ' + 'TextBox1 + ' + Me.TextBox1.Location = New System.Drawing.Point(174, 72) + Me.TextBox1.Name = "TextBox1" + Me.TextBox1.Size = New System.Drawing.Size(75, 20) + Me.TextBox1.TabIndex = 3 + Me.TextBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D + Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label2.Location = New System.Drawing.Point(17, 72) + Me.Label2.MinimumSize = New System.Drawing.Size(40, 0) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(40, 20) + Me.Label2.TabIndex = 4 + Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D + Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label3.Location = New System.Drawing.Point(100, 72) + Me.Label3.MinimumSize = New System.Drawing.Size(40, 0) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(40, 20) + Me.Label3.TabIndex = 5 + Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label4.Location = New System.Drawing.Point(69, 72) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(19, 18) + Me.Label4.TabIndex = 6 + Me.Label4.Text = "X" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 37) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(241, 13) + Me.Label5.TabIndex = 7 + Me.Label5.Text = "------------------------------------------------------------------------------" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D + Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label6.Location = New System.Drawing.Point(171, 110) + Me.Label6.MinimumSize = New System.Drawing.Size(80, 0) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(80, 20) + Me.Label6.TabIndex = 8 + Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(270, 185) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.TextBox1) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.Label1) + Me.Name = "Form1" + Me.Text = "Das kleine 1 x 1" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Button2 As System.Windows.Forms.Button + Friend WithEvents TextBox1 As System.Windows.Forms.TextBox + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label6 As System.Windows.Forms.Label + +End Class diff --git a/Form1.resx b/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Form1.vb b/Form1.vb new file mode 100644 index 0000000..2051c66 --- /dev/null +++ b/Form1.vb @@ -0,0 +1,43 @@ +Public Class Form1 + + Dim Faktor1 As Integer, Faktor2 As Integer, Eingabe As Integer, Ergebnis As Integer + ' Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Label6.Text = "" + Label6.Focus() + Label6.BackColor = Color.LightGray + + Randomize() + Faktor1 = Rnd() * 9 + 1 + Faktor2 = Rnd() * 9 + 1 + + TextBox1.Text = "" + TextBox1.Focus() + + Label2.Text = Convert.ToString(Faktor1) + Label3.Text = Convert.ToString(Faktor2) + End Sub + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + Ergebnis = Faktor1 * Faktor2 + Eingabe = TextBox1.Text + + If Eingabe = Ergebnis Then + Label6.Text = "RICHTIG" + Label6.BackColor = Color.Green + Else + Label6.Text = "FALSCH" + Label6.BackColor = Color.Red + Label6.Focus() + End If + + ' Sleep(2000) + ' Label6.Text = "" + ' Label6.BackColor = Color.LightGray + End Sub + + Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + Button1_Click(sender, e) + End Sub +End Class diff --git a/My Project/Application.Designer.vb b/My Project/Application.Designer.vb new file mode 100644 index 0000000..007b31f --- /dev/null +++ b/My Project/Application.Designer.vb @@ -0,0 +1,37 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = False + Me.EnableVisualStyles = True + Me.SaveMySettingsOnExit = True + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Form1 + End Sub + End Class +End Namespace diff --git a/My Project/Application.myapp b/My Project/Application.myapp new file mode 100644 index 0000000..0f12f32 --- /dev/null +++ b/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + Form1 + false + 0 + true + 0 + true + \ No newline at end of file