teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

``` 追加

2021/03/26 05:20

投稿

ogizo
ogizo

スコア1

title CHANGED
File without changes
body CHANGED
@@ -136,6 +136,7 @@
136
136
  End Sub
137
137
 
138
138
 
139
+ ```
139
140
 
140
141
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
141
142
  Dim valueString As String
@@ -203,7 +204,7 @@
203
204
  MsgBox(“終了”)
204
205
  End If
205
206
 
206
-
207
+ ```
207
208
  End Sub
208
209
 
209
210
  Friend WithEvents TextBox1 As TextBox

1

プログラム

2021/03/26 05:20

投稿

ogizo
ogizo

スコア1

title CHANGED
File without changes
body CHANGED
@@ -5,6 +5,138 @@
5
5
  どなたか解決方法をご教示頂ければ助かります。
6
6
  宜しくお願い致します。
7
7
 
8
+ Imports Microsoft.Office.Interop
9
+
10
+ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
11
+ Partial Class Form1
12
+ Inherits System.Windows.Forms.Form
13
+
14
+ 'フォームがコンポーネントの一覧をクリーンアップするために dispose をオーバーライドします。
15
+ <System.Diagnostics.DebuggerNonUserCode()>
16
+ Protected Overrides Sub Dispose(ByVal disposing As Boolean)
17
+ Try
18
+ If disposing AndAlso components IsNot Nothing Then
19
+ components.Dispose()
20
+ End If
21
+ Finally
22
+ MyBase.Dispose(disposing)
23
+ End Try
24
+ End Sub
25
+
26
+ 'Windows フォーム デザイナーで必要です。
27
+ Private components As System.ComponentModel.IContainer
28
+
29
+ 'メモ: 以下のプロシージャは Windows フォーム デザイナーで必要です。
30
+ 'Windows フォーム デザイナーを使用して変更できます。
31
+ 'コード エディターを使って変更しないでください。
32
+ <System.Diagnostics.DebuggerStepThrough()>
33
+ Private Sub InitializeComponent()
34
+ Me.Button1 = New System.Windows.Forms.Button()
35
+ Me.Label1 = New System.Windows.Forms.Label()
36
+ Me.Label2 = New System.Windows.Forms.Label()
37
+ Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker()
38
+ Me.TextBox1 = New System.Windows.Forms.TextBox()
39
+ Me.TextBox2 = New System.Windows.Forms.TextBox()
40
+ Me.DateTimePicker2 = New System.Windows.Forms.DateTimePicker()
41
+ Me.Button2 = New System.Windows.Forms.Button()
42
+ Me.SuspendLayout()
43
+ '
44
+ 'Button1
45
+ '
46
+ Me.Button1.Location = New System.Drawing.Point(51, 198)
47
+ Me.Button1.Name = "Button1"
48
+ Me.Button1.Size = New System.Drawing.Size(75, 39)
49
+ Me.Button1.TabIndex = 1
50
+ Me.Button1.Text = "出勤"
51
+ Me.Button1.UseVisualStyleBackColor = True
52
+ '
53
+ 'Label1
54
+ '
55
+ Me.Label1.AutoSize = True
56
+ Me.Label1.Location = New System.Drawing.Point(131, 208)
57
+ Me.Label1.Name = "Label1"
58
+ Me.Label1.Size = New System.Drawing.Size(0, 18)
59
+ Me.Label1.TabIndex = 3
60
+ '
61
+ 'Label2
62
+ '
63
+ Me.Label2.AutoSize = True
64
+ Me.Label2.Location = New System.Drawing.Point(48, 152)
65
+ Me.Label2.Name = "Label2"
66
+ Me.Label2.Size = New System.Drawing.Size(0, 18)
67
+ Me.Label2.TabIndex = 4
68
+ '
69
+ 'DateTimePicker1
70
+ '
71
+ Me.DateTimePicker1.CustomFormat = "yyyy/MM/dd HHmm"
72
+ Me.DateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom
73
+ Me.DateTimePicker1.Location = New System.Drawing.Point(51, 108)
74
+ Me.DateTimePicker1.Name = "DateTimePicker1"
75
+ Me.DateTimePicker1.Size = New System.Drawing.Size(253, 25)
76
+ Me.DateTimePicker1.TabIndex = 5
77
+ '
78
+ 'TextBox1
79
+ '
80
+ Me.TextBox1.Location = New System.Drawing.Point(51, 152)
81
+ Me.TextBox1.Name = "TextBox1"
82
+ Me.TextBox1.Size = New System.Drawing.Size(300, 25)
83
+ Me.TextBox1.TabIndex = 6
84
+ '
85
+ 'TextBox2
86
+ '
87
+ Me.TextBox2.Location = New System.Drawing.Point(374, 152)
88
+ Me.TextBox2.Name = "TextBox2"
89
+ Me.TextBox2.Size = New System.Drawing.Size(298, 25)
90
+ Me.TextBox2.TabIndex = 7
91
+ '
92
+ 'DateTimePicker2
93
+ '
94
+ Me.DateTimePicker2.CustomFormat = "yyyy/MM/dd HHmm"
95
+ Me.DateTimePicker2.Format = System.Windows.Forms.DateTimePickerFormat.Custom
96
+ Me.DateTimePicker2.Location = New System.Drawing.Point(374, 108)
97
+ Me.DateTimePicker2.Name = "DateTimePicker2"
98
+ Me.DateTimePicker2.Size = New System.Drawing.Size(261, 25)
99
+ Me.DateTimePicker2.TabIndex = 8
100
+ '
101
+ 'Button2
102
+ '
103
+ Me.Button2.Location = New System.Drawing.Point(374, 198)
104
+ Me.Button2.Name = "Button2"
105
+ Me.Button2.Size = New System.Drawing.Size(73, 39)
106
+ Me.Button2.TabIndex = 9
107
+ Me.Button2.Text = "退勤"
108
+ Me.Button2.UseVisualStyleBackColor = True
109
+ '
110
+ 'Form1
111
+ '
112
+ Me.AutoScaleDimensions = New System.Drawing.SizeF(10.0!, 18.0!)
113
+ Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
114
+ Me.ClientSize = New System.Drawing.Size(800, 450)
115
+ Me.Controls.Add(Me.Button2)
116
+ Me.Controls.Add(Me.DateTimePicker2)
117
+ Me.Controls.Add(Me.TextBox2)
118
+ Me.Controls.Add(Me.TextBox1)
119
+ Me.Controls.Add(Me.DateTimePicker1)
120
+ Me.Controls.Add(Me.Label2)
121
+ Me.Controls.Add(Me.Label1)
122
+ Me.Controls.Add(Me.Button1)
123
+ Me.Name = "Form1"
124
+ Me.Text = "Form1"
125
+ Me.ResumeLayout(False)
126
+ Me.PerformLayout()
127
+
128
+ End Sub
129
+ Friend WithEvents Button1 As Button
130
+ Friend WithEvents Label1 As Label
131
+ Friend WithEvents Label2 As Label
132
+ Friend WithEvents DateTimePicker1 As DateTimePicker
133
+
134
+ Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker1.ValueChanged
135
+
136
+ End Sub
137
+
138
+
139
+
8
140
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
9
141
  Dim valueString As String
10
142
  Dim text As String
@@ -72,4 +204,25 @@
72
204
  End If
73
205
 
74
206
 
75
- End Sub
207
+ End Sub
208
+
209
+ Friend WithEvents TextBox1 As TextBox
210
+ Friend WithEvents TextBox2 As TextBox
211
+ Friend WithEvents DateTimePicker2 As DateTimePicker
212
+
213
+ Private Sub DateTimePicker2_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker2.ValueChanged
214
+
215
+ End Sub
216
+
217
+ Friend WithEvents Button2 As Button
218
+
219
+ Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
220
+ Dim valueString As String
221
+ Dim text As String
222
+
223
+ valueString = DateTimePicker2.Value.ToShortDateString()
224
+ text = DateTimePicker2.Text
225
+
226
+ TextBox2.Text = ControlChars.NewLine & text
227
+ End Sub
228
+ End Class