OSDN Git Service

ver2.1 フォント修正、ファイルダイアログの初期フォルダ指定修正、モードレス時のイベントハンドリング修正
[seraphyscrtools/SeraphyScriptDialog.git] / help / examplecode / sample_chkbutton1_modeless.vbs
diff --git a/help/examplecode/sample_chkbutton1_modeless.vbs b/help/examplecode/sample_chkbutton1_modeless.vbs
new file mode 100644 (file)
index 0000000..45afd52
--- /dev/null
@@ -0,0 +1,23 @@
+Option Explicit
+Dim obj: Set obj = CreateObject("SeraphyScriptDialog")
+Dim frm: Set frm = obj.CreateForm()
+Dim chk1: chk1 = frm.DefineCheckButton("\83`\83F\83b\83N1;\83`\83F\83b\83N2;\83`\83F\83b\83N3", "001")
+Dim lbl1: lbl1 = frm.DefineLabel("")
+Dim btn1: btn1 = frm.DefineButton("OK;Cancel")
+frm.ComposeForm()
+Do
+    Dim ret: ret = frm.WaitEvent(100)
+    If Not IsNull(ret) Then
+        If ret = btn1 Then
+            MsgBox "chk=" & frm.Value(chk1)
+            Exit Do
+
+        ElseIf ret = chk1 Then
+            frm.Value(lbl1) = frm.Value(chk1)
+
+        ElseIf ret = btn1 + 1 Or ret = -1 Then
+            Exit Do
+        End If
+    End If
+Loop
+frm.DestroyForm()