PR
キーワードサーチ
カレンダー
コメント新着
msgbox( picker() ) //デートピッカー呼び出し
//以下プロシジャ・関数
function picker()
result =powershell(datepicker1)
fend
procedure showPicker()
ctrlwin( getid("Select a Date",,-1), show )
fend
textblock datepicker1
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$form = New-Object Windows.Forms.Form
$form.Text = "Select a Date"
$form.Size = New-Object Drawing.Size @(243,230)
$form.StartPosition = "CenterScreen"
$datepicker = New-Object System.Windows.Forms.DateTimePicker
$datepicker.format="Time"
$form.Controls.Add($datepicker)
$OKButton = New-Object System.Windows.Forms.Button
$OKButton.Location = New-Object System.Drawing.Point(38,165)
$OKButton.Size = New-Object System.Drawing.Size(75,23)
$OKButton.Text = "OK"
$OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
$form.AcceptButton = $OKButton
$CancelButton = New-Object System.Windows.Forms.Button
$CancelButton.Location = New-Object System.Drawing.Point(113,165)
$CancelButton.Size = New-Object System.Drawing.Size(75,23)
$CancelButton.Text = "Cancel"
$CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
$DateTimeButton=New-Object System.Windows.Forms.Button
$DateTimeButton.text="Date/Time"
$DateTimeButton.top=$OKButton.top - $OKButton.height - 5
$DateTimeButton.left=$OKButton.left
$DateTimeButton.Add_Click({
if ( $this.parent.Controls.item(0).format -eq "Time" ){
$this.parent.Controls.item(0).format="Long"
}else{
$this.parent.Controls.item(0).format="Time"
}
})
$form.CancelButton = $CancelButton
$OKButton,$DateTimeButton,$CancelButton|%{
$form.Controls.Add($_)
}
$form.Topmost = $True
$result = $form.ShowDialog()
if ($result -eq [System.Windows.Forms.DialogResult]::OK)
{
$datepicker.Value
}
endtextblock
デバッグ中かどうか自動判定 2020.12.19
UWSCダイアログのタイトル変更 2020.11.25
XMLでなんちゃってDB 2019.12.23