練習用です。いろんなものがごちゃまぜです。
| @@ -27,6 +27,7 @@ | ||
| 27 | 27 | Me.Button3 = New System.Windows.Forms.Button() |
| 28 | 28 | Me.Button4 = New System.Windows.Forms.Button() |
| 29 | 29 | Me.Button5 = New System.Windows.Forms.Button() |
| 30 | + Me.Button6 = New System.Windows.Forms.Button() | |
| 30 | 31 | Me.SuspendLayout() |
| 31 | 32 | ' |
| 32 | 33 | 'Button1 |
| @@ -71,14 +72,24 @@ | ||
| 71 | 72 | Me.Button5.Name = "Button5" |
| 72 | 73 | Me.Button5.Size = New System.Drawing.Size(157, 23) |
| 73 | 74 | Me.Button5.TabIndex = 0 |
| 74 | - Me.Button5.Text = "Button1" | |
| 75 | + Me.Button5.Text = "値型と参照型" | |
| 75 | 76 | Me.Button5.UseVisualStyleBackColor = True |
| 76 | 77 | ' |
| 78 | + 'Button6 | |
| 79 | + ' | |
| 80 | + Me.Button6.Location = New System.Drawing.Point(26, 167) | |
| 81 | + Me.Button6.Name = "Button6" | |
| 82 | + Me.Button6.Size = New System.Drawing.Size(157, 23) | |
| 83 | + Me.Button6.TabIndex = 0 | |
| 84 | + Me.Button6.Text = "Button1" | |
| 85 | + Me.Button6.UseVisualStyleBackColor = True | |
| 86 | + ' | |
| 77 | 87 | 'frmMenu |
| 78 | 88 | ' |
| 79 | 89 | Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!) |
| 80 | 90 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font |
| 81 | 91 | Me.ClientSize = New System.Drawing.Size(747, 253) |
| 92 | + Me.Controls.Add(Me.Button6) | |
| 82 | 93 | Me.Controls.Add(Me.Button5) |
| 83 | 94 | Me.Controls.Add(Me.Button4) |
| 84 | 95 | Me.Controls.Add(Me.Button3) |
| @@ -95,4 +106,5 @@ | ||
| 95 | 106 | Friend WithEvents Button3 As Button |
| 96 | 107 | Friend WithEvents Button4 As Button |
| 97 | 108 | Friend WithEvents Button5 As Button |
| 109 | + Friend WithEvents Button6 As Button | |
| 98 | 110 | End Class |
| @@ -14,4 +14,8 @@ | ||
| 14 | 14 | Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click |
| 15 | 15 | Form4.Show() |
| 16 | 16 | End Sub |
| 17 | + | |
| 18 | + Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click | |
| 19 | + Form5.Show() | |
| 20 | + End Sub | |
| 17 | 21 | End Class |
| \ No newline at end of file |
| @@ -0,0 +1,4 @@ | ||
| 1 | +Public Class MyData | |
| 2 | + Public Property X As Integer | |
| 3 | + Public Property Y As Integer | |
| 4 | +End Class |
| @@ -0,0 +1,50 @@ | ||
| 1 | +<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ | |
| 2 | +Partial Class Form5 | |
| 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(65, 51) | |
| 31 | + Me.Button1.Name = "Button1" | |
| 32 | + Me.Button1.Size = New System.Drawing.Size(75, 23) | |
| 33 | + Me.Button1.TabIndex = 0 | |
| 34 | + Me.Button1.Text = "Button1" | |
| 35 | + Me.Button1.UseVisualStyleBackColor = True | |
| 36 | + ' | |
| 37 | + 'Form5 | |
| 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 = "Form5" | |
| 44 | + Me.Text = "Form5" | |
| 45 | + Me.ResumeLayout(False) | |
| 46 | + | |
| 47 | + End Sub | |
| 48 | + | |
| 49 | + Friend WithEvents Button1 As Button | |
| 50 | +End Class |
| @@ -0,0 +1,8 @@ | ||
| 1 | +Public Class Form5 | |
| 2 | + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click | |
| 3 | + Dim num As Integer | |
| 4 | + num = 10 | |
| 5 | + Dim dt As MyData | |
| 6 | + dt = New MyData() With {.X = 100, .Y = 200} | |
| 7 | + End Sub | |
| 8 | +End Class | |
| \ No newline at end of file |