練習用です。いろんなものがごちゃまぜです。
| @@ -0,0 +1,50 @@ | ||
| 1 | +<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ | |
| 2 | +Partial Class Form7 | |
| 3 | + Inherits System.Windows.Forms.Form | |
| 4 | + | |
| 5 | + 'フォームがコンポーネントの一覧をクリーンアップするために dispose をオーバーライドします。 | |
| 6 | + <System.Diagnostics.DebuggerNonUserCode()> _ | |
| 7 | + Protected Overrides Sub Dispose(ByVal disposing As Boolean) | |
| 8 | + Try | |
| 9 | + If disposing AndAlso components IsNot Nothing Then | |
| 10 | + components.Dispose() | |
| 11 | + End If | |
| 12 | + Finally | |
| 13 | + MyBase.Dispose(disposing) | |
| 14 | + End Try | |
| 15 | + End Sub | |
| 16 | + | |
| 17 | + 'Windows フォーム デザイナーで必要です。 | |
| 18 | + Private components As System.ComponentModel.IContainer | |
| 19 | + | |
| 20 | + 'メモ: 以下のプロシージャは Windows フォーム デザイナーで必要です。 | |
| 21 | + 'Windows フォーム デザイナーを使用して変更できます。 | |
| 22 | + 'コード エディターを使って変更しないでください。 | |
| 23 | + <System.Diagnostics.DebuggerStepThrough()> _ | |
| 24 | + Private Sub InitializeComponent() | |
| 25 | + Me.Button1 = New System.Windows.Forms.Button() | |
| 26 | + Me.SuspendLayout() | |
| 27 | + ' | |
| 28 | + 'Button1 | |
| 29 | + ' | |
| 30 | + Me.Button1.Location = New System.Drawing.Point(60, 41) | |
| 31 | + Me.Button1.Name = "Button1" | |
| 32 | + Me.Button1.Size = New System.Drawing.Size(111, 29) | |
| 33 | + Me.Button1.TabIndex = 0 | |
| 34 | + Me.Button1.Text = "Button1" | |
| 35 | + Me.Button1.UseVisualStyleBackColor = True | |
| 36 | + ' | |
| 37 | + 'Form7 | |
| 38 | + ' | |
| 39 | + Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!) | |
| 40 | + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font | |
| 41 | + Me.ClientSize = New System.Drawing.Size(282, 253) | |
| 42 | + Me.Controls.Add(Me.Button1) | |
| 43 | + Me.Name = "Form7" | |
| 44 | + Me.Text = "Form7" | |
| 45 | + Me.ResumeLayout(False) | |
| 46 | + | |
| 47 | + End Sub | |
| 48 | + | |
| 49 | + Friend WithEvents Button1 As Button | |
| 50 | +End Class |
| @@ -0,0 +1,7 @@ | ||
| 1 | +Public Class Form7 | |
| 2 | + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click | |
| 3 | + Dim obj As New MyClass1 | |
| 4 | + obj.Print() | |
| 5 | + obj.PrintWithFormat("data = {0}") | |
| 6 | + End Sub | |
| 7 | +End Class | |
| \ No newline at end of file |
| @@ -0,0 +1,8 @@ | ||
| 1 | +Public Class MyClass1 | |
| 2 | + Public Property Data As Integer = 100 | |
| 3 | + | |
| 4 | + Public Sub Print() | |
| 5 | + MsgBox(Data) | |
| 6 | + End Sub | |
| 7 | + | |
| 8 | +End Class |
| @@ -0,0 +1,8 @@ | ||
| 1 | +Module Module1 | |
| 2 | + | |
| 3 | + <System.Runtime.CompilerServices.Extension()> | |
| 4 | + Public Sub PrintWithFormat(ByVal obj As MyClass1, ByVal fmt As String) | |
| 5 | + MsgBox(String.Format(fmt, obj.Data)) | |
| 6 | + End Sub | |
| 7 | + | |
| 8 | +End Module |
| @@ -29,6 +29,7 @@ | ||
| 29 | 29 | Me.Button5 = New System.Windows.Forms.Button() |
| 30 | 30 | Me.Button6 = New System.Windows.Forms.Button() |
| 31 | 31 | Me.Button7 = New System.Windows.Forms.Button() |
| 32 | + Me.Button8 = New System.Windows.Forms.Button() | |
| 32 | 33 | Me.SuspendLayout() |
| 33 | 34 | ' |
| 34 | 35 | 'Button1 |
| @@ -91,14 +92,24 @@ | ||
| 91 | 92 | Me.Button7.Name = "Button7" |
| 92 | 93 | Me.Button7.Size = New System.Drawing.Size(157, 23) |
| 93 | 94 | Me.Button7.TabIndex = 0 |
| 94 | - Me.Button7.Text = "Button1" | |
| 95 | + Me.Button7.Text = "Extention" | |
| 95 | 96 | Me.Button7.UseVisualStyleBackColor = True |
| 96 | 97 | ' |
| 98 | + 'Button8 | |
| 99 | + ' | |
| 100 | + Me.Button8.Location = New System.Drawing.Point(26, 225) | |
| 101 | + Me.Button8.Name = "Button8" | |
| 102 | + Me.Button8.Size = New System.Drawing.Size(157, 23) | |
| 103 | + Me.Button8.TabIndex = 0 | |
| 104 | + Me.Button8.Text = "Button1" | |
| 105 | + Me.Button8.UseVisualStyleBackColor = True | |
| 106 | + ' | |
| 97 | 107 | 'frmMenu |
| 98 | 108 | ' |
| 99 | 109 | Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!) |
| 100 | 110 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font |
| 101 | 111 | Me.ClientSize = New System.Drawing.Size(747, 253) |
| 112 | + Me.Controls.Add(Me.Button8) | |
| 102 | 113 | Me.Controls.Add(Me.Button7) |
| 103 | 114 | Me.Controls.Add(Me.Button6) |
| 104 | 115 | Me.Controls.Add(Me.Button5) |
| @@ -119,4 +130,5 @@ | ||
| 119 | 130 | Friend WithEvents Button5 As Button |
| 120 | 131 | Friend WithEvents Button6 As Button |
| 121 | 132 | Friend WithEvents Button7 As Button |
| 133 | + Friend WithEvents Button8 As Button | |
| 122 | 134 | End Class |
| @@ -22,4 +22,8 @@ | ||
| 22 | 22 | Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click |
| 23 | 23 | Form6.Show() |
| 24 | 24 | End Sub |
| 25 | + | |
| 26 | + Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click | |
| 27 | + Form7.Show() | |
| 28 | + End Sub | |
| 25 | 29 | End Class |
| \ No newline at end of file |