|
Sub
GetnextWeekDate() '次の曜日の日時が設定・保存 の処理ルーティン全文
Dim
H3
As
String
= ComboBox5.SelectedItem
'待ち時間入力
Dim
M4
As
String
= ComboBox6.SelectedItem
'待ち分入力
Dim
S9
As
String
= ComboBox7.SelectedItem
'待ち秒入力
Dim
H11
As
String
= ComboBox8.SelectedItem
'待ち時間入力
Dim
M12
As
String
= ComboBox9.SelectedItem
'待ち分入力
Dim
S18
As
String
= ComboBox10.SelectedItem
'待ち秒入力
Dim
myDate
As
Date
= Now() '指定曜日の暦日処理
Dim
myDate2
As
Date
= Now()
Dim
myDate3
As
Date
= Now()
Dim
wName
As
String
Dim
NN
As
Integer
Dim
nextDay
As
Date
Dim
nWeek
As
String
= ComboBox14.SelectedItem
If
ComboBox14.SelectedItem =
"***"
Then
:
GoTo
BBBB :
End
If
If
ComboBox14.SelectedItem =
"sun"
Then
: nWeek =
"日曜日"
:
GoTo
BBBB :
End
If
If
ComboBox14.SelectedItem =
"mon"
Then
: nWeek =
"月曜日"
:
GoTo
BBBB :
End
If
If
ComboBox14.SelectedItem =
"tue"
Then
: nWeek =
"火曜日"
:
GoTo
BBBB :
End
If
If
ComboBox14.SelectedItem =
"wed"
Then
: nWeek =
"水曜日"
:
GoTo
BBBB :
End
If
If
ComboBox14.SelectedItem =
"thr"
Then
: nWeek =
"木曜日"
:
GoTo
BBBB :
End
If
If
ComboBox14.SelectedItem =
"fri"
Then
: nWeek =
"金曜日"
:
GoTo
BBBB :
End
If
If
ComboBox14.SelectedItem =
"sat"
Then
: nWeek =
"土曜日"
:
GoTo
BBBB :
End
If
BBBB: If
ComboBox14.SelectedItem =
"***"
Then '指定曜日の歴日計算
nextDay = myDate3.AddDays(0)
My.Settings.nDay
= nextDay
My.Settings.weekN
= ComboBox14.SelectedItem
Else
For
NN = 1
To
7
wName =
WeekdayName(Weekday(myDate.AddDays(NN)))
If
wName = nWeek
Then
' WeekdayName(Weekday(myDate2)) Then
nextDay = myDate3.AddDays(NN)
My.Settings.nDay
= nextDay
My.Settings.weekN
= ComboBox14.SelectedItem
End
If
Next
End
If
Dim
nD1
As
String
= Format(CDate(My.Settings.nDay)) ’StartTimeの保存処理
Dim
nD11
As
DateTime
=
DateTime.Parse(nD1)
My.Settings.nDay1
= Format(nD11,
"yyyy/MM/dd")
Dim
wD11
As
String
= WeekdayName((Weekday(nD11)),
True)
If
wD11 =
"日"
Then
wD11 =
"sun"
If
wD11 =
"月"
Then
wD11 =
"mon"
If
wD11 =
"火"
Then
wD11 =
"tue"
If
wD11 =
"水"
Then
wD11 =
"wed"
If
wD11 =
"木"
Then
wD11 =
"thr"
If
wD11 =
"金"
Then
wD11 =
"fri"
If
wD11 =
"土"
Then
wD11 =
"sat"
TextBox13.Text = wD11
My.Settings.wD1
= wD11
Dim
naD1
As
String
= Format(CDate(My.Settings.nDay),
"yyyy:MM:dd")
Dim
sT1
As
String
sT1 = naD1 &
" "
& H3 &
":"
& M4 &
":"
& S9
TextBox11.Text = sT1
My.Settings.onT
= TextBox11.Text
My.Settings.nH1
= ComboBox5.SelectedItem
My.Settings.nM1
= ComboBox6.SelectedItem
My.Settings.nS1
= ComboBox7.SelectedItem
Dim
nDD2
As
Date 'StopTimeの保存処理
If
H3 > H11
Then 'StopTimeが翌日となる場合の処理
nDD2 =
My.Settings.nDay.AddDays(1)
Else
nDD2 =
My.Settings.nDay
End
If
Dim
nD2
As
String
= Format(CDate(nDD2))
Dim
nD22
As
DateTime
=
DateTime.Parse(nD2)
My.Settings.nDay2
= Format(nD22,
"yyyy/MM/dd")
Dim
wD22
As
String
= WeekdayName((Weekday(nD22)),
True)
If
wD22 =
"日"
Then
wD22 =
"sun"
If
wD22 =
"月"
Then
wD22 =
"mon"
If
wD22 =
"火"
Then
wD22 =
"tue"
If
wD22 =
"水"
Then
wD22 =
"wed"
If
wD22 =
"木"
Then
wD22 =
"thr"
If
wD22 =
"金"
Then
wD22 =
"fri"
If
wD22 =
"土"
Then
wD22 =
"sat"
TextBox14.Text
= wD22
My.Settings.wD2
= wD22
Dim
naD2
As
String
= Format(CDate(nDD2),
"yyyy:MM:dd")
Dim
sT2
As
String
sT2 = naD2 &
" "
& H11 &
":"
& M12 &
":"
& S18
TextBox12.Text = sT2
My.Settings.offT
= TextBox12.Text
My.Settings.nH2
= ComboBox8.SelectedItem
My.Settings.nM2
= ComboBox9.SelectedItem
My.Settings.nS2
= ComboBox10.SelectedItem
End
Sub
注:上記以外に 選局先や時間の保存のため Private
Sub
Form1_Load(sender
As
Object,
e
As
EventArgs)
Handles
MyBase.Load、 Private
Sub
Form1_FormClosing(ByVal
sender
As
Object,
ByVal
e
As
_System.Windows.Forms.FormClosingEventArgs)
Handles
Me.FormClosing や プロパティの設定 での My.Setting の処理が必要となるが省略しています。
|