Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

卜卦.vb 124KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. Option Strict Off
  2. Imports System.Data.SqlClient
  3. Public Class 卜卦
  4. Dim conn As New SqlConnection
  5. Dim da As New SqlDataAdapter
  6. Dim cmd As New SqlCommand
  7. Dim dr As SqlDataReader
  8. Dim conn1 As New SqlConnection
  9. Dim cmd1 As New SqlCommand
  10. Dim dr1 As SqlDataReader
  11. Dim ds As New DataSet
  12. Dim NUM1 As Integer : Dim NUM2(6) As Integer
  13. Private Sub Set_grid()
  14. DataGridView1.Columns(0).Width = 53 : DataGridView1.Columns(1).Width = 87 : DataGridView1.Columns(2).Width = 53 : DataGridView1.Columns(3).Width = 53
  15. DataGridView1.Columns(4).Width = 53 : DataGridView1.Columns(5).Width = 42 : DataGridView1.Columns(6).Width = 42 : DataGridView1.Columns(7).Width = 60
  16. DataGridView1.Columns(8).Width = 195 : DataGridView1.Columns(9).Visible = False : DataGridView1.Columns(10).Visible = False : DataGridView1.Columns(11).Visible = False
  17. End Sub
  18. Private Sub Set_格式設定()
  19. TextBox25.Visible = False : TextBox26.Visible = False : TextBox27.Visible = False : TextBox28.Visible = False : TextBox29.Visible = False : TextBox30.Visible = False
  20. TextBox31.Visible = False : TextBox32.Visible = False : TextBox33.Visible = False : TextBox34.Visible = False : TextBox35.Visible = False : TextBox36.Visible = False
  21. TextBox37.Visible = False : TextBox38.Visible = False : TextBox39.Visible = False : TextBox40.Visible = False : TextBox41.Visible = False : TextBox42.Visible = False
  22. TextBox43.Visible = False : TextBox44.Visible = False : TextBox45.Visible = False : TextBox46.Visible = False : TextBox47.Visible = False : TextBox48.Visible = False
  23. TextBox49.Visible = False : TextBox50.Visible = False : TextBox51.Visible = False : TextBox52.Visible = False : TextBox53.Visible = False : TextBox54.Visible = False
  24. Label34.Visible = False : Label35.Visible = False : Label36.Visible = False : Label37.Visible = False : Label38.Visible = False : Label39.Visible = False
  25. TextBox55.Visible = False : TextBox56.Visible = False : TextBox57.Visible = False : TextBox58.Visible = False : TextBox59.Visible = False : TextBox60.Visible = False
  26. TextBox61.Visible = False : TextBox62.Visible = False : TextBox63.Visible = False : TextBox64.Visible = False : TextBox65.Visible = False : TextBox66.Visible = False
  27. TextBox67.Visible = False : TextBox68.Visible = False : TextBox69.Visible = False : TextBox70.Visible = False : TextBox71.Visible = False : TextBox72.Visible = False
  28. TextBox73.Visible = False : TextBox74.Visible = False : TextBox75.Visible = False : TextBox76.Visible = False : TextBox77.Visible = False : TextBox78.Visible = False
  29. TextBox79.Visible = False : TextBox80.Visible = False : TextBox81.Visible = False : TextBox82.Visible = False : TextBox83.Visible = False : TextBox84.Visible = False
  30. TextBox85.Visible = False : TextBox86.Visible = False : TextBox87.Visible = False : TextBox88.Visible = False : TextBox89.Visible = False : TextBox90.Visible = False
  31. TextBox91.Visible = False : TextBox92.Visible = False : TextBox93.Visible = False : TextBox94.Visible = False : TextBox95.Visible = False : TextBox96.Visible = False
  32. TextBox102.Visible = False : TextBox103.Visible = False : TextBox104.Visible = False : TextBox105.Visible = False : TextBox106.Visible = False : TextBox107.Visible = False
  33. TextBox108.Visible = False : TextBox109.Visible = False : TextBox110.Visible = False : TextBox111.Visible = False : TextBox112.Visible = False : TextBox113.Visible = False
  34. TextBox114.Visible = False : TextBox115.Visible = False : TextBox116.Visible = False : TextBox117.Visible = False : TextBox118.Visible = False : TextBox119.Visible = False
  35. TextBox120.Visible = False : TextBox121.Visible = False : TextBox122.Visible = False : TextBox123.Visible = False : TextBox124.Visible = False : TextBox125.Visible = False
  36. TextBox126.Visible = False : TextBox127.Visible = False : TextBox128.Visible = False : TextBox129.Visible = False : TextBox130.Visible = False : TextBox131.Visible = False
  37. Label40.Visible = False : Label41.Visible = False : Label42.Visible = False : Label43.Visible = False : Label44.Visible = False : Label45.Visible = False
  38. TextBox133.Visible = False : TextBox134.Visible = False : TextBox135.Visible = False : TextBox136.Visible = False : TextBox137.Visible = False : TextBox138.Visible = False
  39. TextBox226.Visible = False : TextBox227.Visible = False : TextBox193.Visible = False : TextBox194.Visible = False : TextBox195.Visible = False : TextBox196.Visible = False
  40. TextBox197.Visible = False : TextBox198.Visible = False
  41. End Sub
  42. Private Sub Set_萬年曆()
  43. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  44. SQL1 = "SELECT 年, 月, 旬, 日, 旬空1, 旬空2 FROM 萬年曆 WHERE (西元 = '" & Format(DateTimePicker1.Value, "yyyy/MM/dd") & "')"
  45. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  46. If dr1.Read() Then
  47. TextBox1.Text = dr1("年").ToString : TextBox2.Text = dr1("月").ToString : TextBox3.Text = dr1("旬").ToString : TextBox4.Text = dr1("日").ToString
  48. TextBox97.Text = dr1("旬空1").ToString : TextBox98.Text = dr1("旬空2").ToString
  49. End If
  50. conn1.Close() : dr1.Close()
  51. End Sub
  52. Private Sub Set_萬年曆五行()
  53. For NUM1 = 1 To 4
  54. Dim 條件1 As String = "(地支 = RIGHT('" & TextBox1.Text & "', 1))" : Dim 條件2 As String = "(地支 = RIGHT('" & TextBox2.Text & "', 1))"
  55. Dim 條件3 As String = "(地支 = RIGHT('" & TextBox3.Text & "', 1))" : Dim 條件4 As String = "(地支 = RIGHT('" & TextBox4.Text & "', 1))"
  56. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  57. If NUM1 = 1 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件1 : End If : If NUM1 = 2 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件2 : End If
  58. If NUM1 = 3 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件3 : End If : If NUM1 = 4 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件4 : End If
  59. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  60. If dr1.Read() Then
  61. If NUM1 = 1 Then : TextBox5.Text = dr1("五行").ToString : End If : If NUM1 = 2 Then : TextBox6.Text = dr1("五行").ToString : End If
  62. If NUM1 = 3 Then : TextBox7.Text = dr1("五行").ToString : End If : If NUM1 = 4 Then : TextBox8.Text = dr1("五行").ToString : End If
  63. End If
  64. conn1.Close() : dr1.Close()
  65. Next
  66. TextBox9.Text = TextBox6.Text
  67. End Sub
  68. Private Sub Set_相氣休囚()
  69. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  70. SQL1 = "SELECT 相, 氣, 休, 囚 FROM 地支五行 WHERE (地支 = RIGHT('" & TextBox2.Text & "', 1))"
  71. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  72. If dr1.Read() Then
  73. TextBox10.Text = dr1("相").ToString : TextBox11.Text = dr1("氣").ToString
  74. TextBox187.Text = dr1("休").ToString : TextBox188.Text = dr1("囚").ToString
  75. End If
  76. conn1.Close() : dr1.Close()
  77. End Sub
  78. Private Sub Set_六獸()
  79. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "甲" Or Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "乙" Then
  80. Label9.Text = "青龍" : Label10.Text = "朱雀" : Label11.Text = "勾陳" : Label12.Text = "騰蛇" : Label13.Text = "白虎" : Label14.Text = "玄武" : Else
  81. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "丙" Or Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "丁" Then
  82. Label9.Text = "朱雀" : Label10.Text = "勾陳" : Label11.Text = "騰蛇" : Label12.Text = "白虎" : Label13.Text = "玄武" : Label14.Text = "青龍" : Else
  83. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "戊" Then
  84. Label9.Text = "勾陳" : Label10.Text = "騰蛇" : Label11.Text = "白虎" : Label12.Text = "玄武" : Label13.Text = "青龍" : Label14.Text = "朱雀" : Else
  85. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "己" Then
  86. Label9.Text = "騰蛇" : Label10.Text = "白虎" : Label11.Text = "玄武" : Label12.Text = "青龍" : Label13.Text = "朱雀" : Label14.Text = "勾陳" : Else
  87. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "庚" Or Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "辛" Then
  88. Label9.Text = "白虎" : Label10.Text = "玄武" : Label11.Text = "青龍" : Label12.Text = "朱雀" : Label13.Text = "勾陳" : Label14.Text = "騰蛇" : Else
  89. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "壬" Or Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "癸" Then
  90. Label9.Text = "玄武" : Label10.Text = "青龍" : Label11.Text = "朱雀" : Label12.Text = "勾陳" : Label13.Text = "騰蛇" : Label14.Text = "白虎"
  91. End If : End If : End If : End If : End If : End If
  92. End Sub
  93. Private Sub Set_日長生()
  94. If TextBox8.Text = "火" Then
  95. TextBox145.Text = "寅" : TextBox146.Text = "卯" : TextBox147.Text = "辰" : TextBox148.Text = "巳" : TextBox149.Text = "午" : TextBox150.Text = "未"
  96. TextBox151.Text = "申" : TextBox152.Text = "酉" : TextBox153.Text = "戌" : TextBox154.Text = "亥" : TextBox155.Text = "子" : TextBox156.Text = "丑"
  97. Else
  98. If TextBox8.Text = "金" Then
  99. TextBox145.Text = "巳" : TextBox146.Text = "午" : TextBox147.Text = "未" : TextBox148.Text = "申" : TextBox149.Text = "酉" : TextBox150.Text = "戌"
  100. TextBox151.Text = "亥" : TextBox152.Text = "子" : TextBox153.Text = "丑" : TextBox154.Text = "寅" : TextBox155.Text = "卯" : TextBox156.Text = "辰"
  101. Else
  102. If TextBox8.Text = "水" Then
  103. TextBox145.Text = "申" : TextBox146.Text = "酉" : TextBox147.Text = "戌" : TextBox148.Text = "亥" : TextBox149.Text = "子" : TextBox150.Text = "丑"
  104. TextBox151.Text = "寅" : TextBox152.Text = "卯" : TextBox153.Text = "辰" : TextBox154.Text = "巳" : TextBox155.Text = "午" : TextBox156.Text = "未"
  105. Else
  106. If TextBox8.Text = "木" Then
  107. TextBox145.Text = "亥" : TextBox146.Text = "子" : TextBox147.Text = "丑" : TextBox148.Text = "寅" : TextBox149.Text = "卯" : TextBox150.Text = "辰"
  108. TextBox151.Text = "巳" : TextBox152.Text = "午" : TextBox153.Text = "未" : TextBox154.Text = "申" : TextBox155.Text = "酉" : TextBox156.Text = "戌"
  109. Else
  110. If TextBox8.Text = "土" Then
  111. TextBox145.Text = "申" : TextBox146.Text = "酉" : TextBox147.Text = "戌" : TextBox148.Text = "亥" : TextBox149.Text = "子" : TextBox150.Text = "丑"
  112. TextBox151.Text = "寅" : TextBox152.Text = "卯" : TextBox153.Text = "辰" : TextBox154.Text = "巳" : TextBox155.Text = "午" : TextBox156.Text = "未"
  113. End If : End If : End If : End If : End If
  114. End Sub
  115. Private Sub Set_排掛()
  116. If ComboBox1.Text = "1" Then
  117. Label15.Text = "一" : Label16.Text = "一" : Label17.Text = "一" : Label21.Text = "甲" : Label22.Text = "甲" : Label23.Text = "甲"
  118. Label27.Text = "子" : Label28.Text = "寅" : Label29.Text = "辰" : Else
  119. If ComboBox1.Text = "2" Then
  120. Label15.Text = "一" : Label16.Text = "一" : Label17.Text = "- -" : Label21.Text = "丁" : Label22.Text = "丁" : Label23.Text = "丁"
  121. Label27.Text = "巳" : Label28.Text = "卯" : Label29.Text = "丑" : Else
  122. If ComboBox1.Text = "3" Then
  123. Label15.Text = "一" : Label16.Text = "- -" : Label17.Text = "一" : Label21.Text = "己" : Label22.Text = "己" : Label23.Text = "己"
  124. Label27.Text = "卯" : Label28.Text = "丑" : Label29.Text = "亥" : Else
  125. If ComboBox1.Text = "4" Then
  126. Label15.Text = "一" : Label16.Text = "- -" : Label17.Text = "- -" : Label21.Text = "庚" : Label22.Text = "庚" : Label23.Text = "庚"
  127. Label27.Text = "子" : Label28.Text = "寅" : Label29.Text = "辰" : Else
  128. If ComboBox1.Text = "5" Then
  129. Label15.Text = "- -" : Label16.Text = "一" : Label17.Text = "一" : Label21.Text = "辛" : Label22.Text = "辛" : Label23.Text = "辛"
  130. Label27.Text = "丑" : Label28.Text = "亥" : Label29.Text = "酉" : Else
  131. If ComboBox1.Text = "6" Then
  132. Label15.Text = "- -" : Label16.Text = "一" : Label17.Text = "- -" : Label21.Text = "戊" : Label22.Text = "戊" : Label23.Text = "戊"
  133. Label27.Text = "寅" : Label28.Text = "辰" : Label29.Text = "午" : Else
  134. If ComboBox1.Text = "7" Then
  135. Label15.Text = "- -" : Label16.Text = "- -" : Label17.Text = "一" : Label21.Text = "丙" : Label22.Text = "丙" : Label23.Text = "丙"
  136. Label27.Text = "辰" : Label28.Text = "午" : Label29.Text = "申" : Else
  137. If ComboBox1.Text = "8" Then
  138. Label15.Text = "- -" : Label16.Text = "- -" : Label17.Text = "- -" : Label21.Text = "乙" : Label22.Text = "乙" : Label23.Text = "乙"
  139. Label27.Text = "未" : Label28.Text = "巳" : Label29.Text = "卯"
  140. End If : End If : End If : End If : End If : End If : End If : End If
  141. If ComboBox2.Text = "1" Then
  142. Label18.Text = "一" : Label19.Text = "一" : Label20.Text = "一" : Label24.Text = "壬" : Label25.Text = "壬" : Label26.Text = "壬"
  143. Label30.Text = "午" : Label31.Text = "申" : Label32.Text = "戌" : Else
  144. If ComboBox2.Text = "2" Then
  145. Label18.Text = "一" : Label19.Text = "一" : Label20.Text = "- -" : Label24.Text = "丁" : Label25.Text = "丁" : Label26.Text = "丁"
  146. Label30.Text = "亥" : Label31.Text = "酉" : Label32.Text = "未" : Else
  147. If ComboBox2.Text = "3" Then
  148. Label18.Text = "一" : Label19.Text = "- -" : Label20.Text = "一" : Label24.Text = "己" : Label25.Text = "己" : Label26.Text = "己"
  149. Label30.Text = "酉" : Label31.Text = "未" : Label32.Text = "巳" : Else
  150. If ComboBox2.Text = "4" Then
  151. Label18.Text = "一" : Label19.Text = "- -" : Label20.Text = "- -" : Label24.Text = "庚" : Label25.Text = "庚" : Label26.Text = "庚"
  152. Label30.Text = "午" : Label31.Text = "申" : Label32.Text = "戌" : Else
  153. If ComboBox2.Text = "5" Then
  154. Label18.Text = "- -" : Label19.Text = "一" : Label20.Text = "一" : Label24.Text = "辛" : Label25.Text = "辛" : Label26.Text = "辛"
  155. Label30.Text = "未" : Label31.Text = "巳" : Label32.Text = "卯" : Else
  156. If ComboBox2.Text = "6" Then
  157. Label18.Text = "- -" : Label19.Text = "一" : Label20.Text = "- -" : Label24.Text = "戊" : Label25.Text = "戊" : Label26.Text = "戊"
  158. Label30.Text = "申" : Label31.Text = "戌" : Label32.Text = "子" : Else
  159. If ComboBox2.Text = "7" Then
  160. Label18.Text = "- -" : Label19.Text = "- -" : Label20.Text = "一" : Label24.Text = "丙" : Label25.Text = "丙" : Label26.Text = "丙"
  161. Label30.Text = "戌" : Label31.Text = "子" : Label32.Text = "寅" : Else
  162. If ComboBox2.Text = "8" Then
  163. Label18.Text = "- -" : Label19.Text = "- -" : Label20.Text = "- -" : Label24.Text = "癸" : Label25.Text = "癸" : Label26.Text = "癸"
  164. Label30.Text = "丑" : Label31.Text = "亥" : Label32.Text = "酉"
  165. End If : End If : End If : End If : End If : End If : End If : End If
  166. End Sub
  167. Private Sub Set_化掛()
  168. If Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 1 Or
  169. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 7 Or
  170. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 13 Or
  171. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 19 Then
  172. If Label15.Text = "一" Then : Label15.Text = "O" : Else : Label15.Text = "X" : End If : Else
  173. If Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 2 Or
  174. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 8 Or
  175. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 14 Or
  176. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 20 Then
  177. If Label16.Text = "一" Then : Label16.Text = "O" : Else : Label16.Text = "X" : End If : Else
  178. If Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 3 Or
  179. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 9 Or
  180. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 15 Or
  181. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 21 Then
  182. If Label17.Text = "一" Then : Label17.Text = "O" : Else : Label17.Text = "X" : End If : Else
  183. If Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 4 Or
  184. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 10 Or
  185. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 16 Or
  186. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 22 Then
  187. If Label18.Text = "一" Then : Label18.Text = "O" : Else : Label18.Text = "X" : End If : Else
  188. If Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 5 Or
  189. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 11 Or
  190. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 17 Or
  191. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 23 Then
  192. If Label19.Text = "一" Then : Label19.Text = "O" : Else : Label19.Text = "X" : End If : Else
  193. If Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 6 Or
  194. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 12 Or
  195. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 18 Or
  196. Double.Parse(ComboBox1.Text) + Double.Parse(ComboBox2.Text) + Double.Parse(ComboBox3.Text) = 24 Then
  197. If Label20.Text = "一" Then : Label20.Text = "O" : Else : Label20.Text = "X" : End If
  198. End If : End If : End If : End If : End If : End If
  199. End Sub
  200. Private Sub Set_裝掛()
  201. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  202. SQL1 = "SELECT 初爻, 二爻, 三爻, 四爻, 五爻, 上爻 FROM 八卦六親 WHERE (卦數 = '" & ComboBox2.Text + ComboBox1.Text & "')"
  203. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  204. If dr1.Read() Then
  205. TextBox12.Text = dr1("初爻").ToString : TextBox13.Text = dr1("二爻").ToString : TextBox14.Text = dr1("三爻").ToString
  206. TextBox15.Text = dr1("四爻").ToString : TextBox16.Text = dr1("五爻").ToString : TextBox17.Text = dr1("上爻").ToString
  207. End If
  208. conn1.Close() : dr1.Close()
  209. End Sub
  210. Private Sub Set_掛名()
  211. For NUM1 = 1 To 4
  212. Dim 條件1 As String = "SELECT 卦名 FROM 八卦六親 WHERE (卦數 = '" & ComboBox2.Text + ComboBox1.Text & "')"
  213. Dim 條件2 As String = "SELECT 五行 FROM 八卦六親 WHERE (卦數 = '" & ComboBox2.Text + ComboBox1.Text & "')"
  214. Dim 條件3 As String = "SELECT 化卦名 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  215. Dim 條件4 As String = "SELECT 五行 FROM 八卦六親 WHERE (卦名 = '" & TextBox100.Text & "')"
  216. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  217. If NUM1 = 1 Then : SQL1 = 條件1 : End If : If NUM1 = 2 Then : SQL1 = 條件2 : End If
  218. If NUM1 = 3 Then : SQL1 = 條件3 : End If : If NUM1 = 4 Then : SQL1 = 條件4 : End If
  219. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  220. If dr1.Read() Then
  221. If NUM1 = 1 Then : TextBox24.Text = dr1("卦名").ToString : End If : If NUM1 = 2 Then : TextBox99.Text = dr1("五行").ToString : End If
  222. If NUM1 = 3 Then : TextBox100.Text = dr1("化卦名").ToString : End If : If NUM1 = 4 Then : TextBox101.Text = dr1("五行").ToString : End If
  223. End If
  224. conn1.Close() : dr1.Close()
  225. Next
  226. End Sub
  227. Private Sub Set_掛地支五行()
  228. For NUM1 = 1 To 6
  229. Dim 條件5 As String = "(地支 = '" & Label27.Text & "')" : Dim 條件6 As String = "(地支 = '" & Label28.Text & "')"
  230. Dim 條件7 As String = "(地支 = '" & Label29.Text & "')" : Dim 條件8 As String = "(地支 = '" & Label30.Text & "')"
  231. Dim 條件9 As String = "(地支 = '" & Label31.Text & "')" : Dim 條件10 As String = "(地支 = '" & Label32.Text & "')"
  232. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  233. If NUM1 = 1 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件5 : End If : If NUM1 = 2 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件6 : End If
  234. If NUM1 = 3 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件7 : End If : If NUM1 = 4 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件8 : End If
  235. If NUM1 = 5 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件9 : End If : If NUM1 = 6 Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件10 : End If
  236. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  237. If dr1.Read() Then
  238. If NUM1 = 1 Then : TextBox18.Text = dr1("五行").ToString : End If : If NUM1 = 2 Then : TextBox19.Text = dr1("五行").ToString : End If
  239. If NUM1 = 3 Then : TextBox20.Text = dr1("五行").ToString : End If : If NUM1 = 4 Then : TextBox21.Text = dr1("五行").ToString : End If
  240. If NUM1 = 5 Then : TextBox22.Text = dr1("五行").ToString : End If : If NUM1 = 6 Then : TextBox23.Text = dr1("五行").ToString : End If
  241. End If
  242. conn1.Close() : dr1.Close()
  243. Next
  244. End Sub
  245. Private Sub Set_世應伏身()
  246. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  247. SQL1 = "SELECT 世應初爻, 世應二爻, 世應三爻, 世應四爻,世應五爻,世應上爻, 初爻卦身, 二爻卦身, 三爻卦身, 四爻卦身, 五爻卦身, 上爻卦身, 初爻伏一, " &
  248. "二爻伏一, 三爻伏一, 四爻伏一, 五爻伏一, 上爻伏一, 初爻伏二, 二爻伏二, 三爻伏二, 四爻伏二, 五爻伏二, 上爻伏二, 初爻伏三, 二爻伏三, " &
  249. "三爻伏三, 四爻伏三, 五爻伏三, 上爻伏三 FROM 八卦六親 " &
  250. "WHERE (卦數 = '" & ComboBox2.Text + ComboBox1.Text & "')"
  251. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  252. If dr1.Read() Then
  253. TextBox25.Text = dr1("世應初爻").ToString : TextBox26.Text = dr1("世應二爻").ToString : TextBox27.Text = dr1("世應三爻").ToString
  254. TextBox28.Text = dr1("世應四爻").ToString : TextBox29.Text = dr1("世應五爻").ToString : TextBox30.Text = dr1("世應上爻").ToString
  255. TextBox31.Text = dr1("初爻卦身").ToString : TextBox32.Text = dr1("二爻卦身").ToString : TextBox33.Text = dr1("三爻卦身").ToString
  256. TextBox34.Text = dr1("四爻卦身").ToString : TextBox35.Text = dr1("五爻卦身").ToString : TextBox36.Text = dr1("上爻卦身").ToString
  257. TextBox37.Text = dr1("初爻伏一").ToString : TextBox38.Text = dr1("二爻伏一").ToString : TextBox39.Text = dr1("三爻伏一").ToString
  258. TextBox40.Text = dr1("四爻伏一").ToString : TextBox41.Text = dr1("五爻伏一").ToString : TextBox42.Text = dr1("上爻伏一").ToString
  259. TextBox43.Text = dr1("初爻伏二").ToString : TextBox44.Text = dr1("二爻伏二").ToString : TextBox45.Text = dr1("三爻伏二").ToString
  260. TextBox46.Text = dr1("四爻伏二").ToString : TextBox47.Text = dr1("五爻伏二").ToString : TextBox48.Text = dr1("上爻伏二").ToString
  261. TextBox49.Text = dr1("初爻伏三").ToString : TextBox50.Text = dr1("二爻伏三").ToString : TextBox51.Text = dr1("三爻伏三").ToString
  262. TextBox52.Text = dr1("四爻伏三").ToString : TextBox53.Text = dr1("五爻伏三").ToString : TextBox54.Text = dr1("上爻伏三").ToString
  263. End If
  264. conn1.Close() : dr1.Close()
  265. If TextBox25.Text <> "0" Then : TextBox25.Visible = True : End If : If TextBox26.Text <> "0" Then : TextBox26.Visible = True : End If
  266. If TextBox27.Text <> "0" Then : TextBox27.Visible = True : End If : If TextBox28.Text <> "0" Then : TextBox28.Visible = True : End If
  267. If TextBox29.Text <> "0" Then : TextBox29.Visible = True : End If : If TextBox30.Text <> "0" Then : TextBox30.Visible = True : End If
  268. If TextBox31.Text <> "0" Then : TextBox31.Visible = True : End If : If TextBox32.Text <> "0" Then : TextBox32.Visible = True : End If
  269. If TextBox33.Text <> "0" Then : TextBox33.Visible = True : End If : If TextBox34.Text <> "0" Then : TextBox34.Visible = True : End If
  270. If TextBox35.Text <> "0" Then : TextBox35.Visible = True : End If : If TextBox36.Text <> "0" Then : TextBox36.Visible = True : End If
  271. If TextBox37.Text <> "0" Then : TextBox37.Visible = True : End If : If TextBox38.Text <> "0" Then : TextBox38.Visible = True : End If
  272. If TextBox39.Text <> "0" Then : TextBox39.Visible = True : End If : If TextBox40.Text <> "0" Then : TextBox40.Visible = True : End If
  273. If TextBox41.Text <> "0" Then : TextBox41.Visible = True : End If : If TextBox42.Text <> "0" Then : TextBox42.Visible = True : End If
  274. If TextBox43.Text <> "0" Then : TextBox43.Visible = True : Label34.Visible = True : End If
  275. If TextBox44.Text <> "0" Then : TextBox44.Visible = True : Label35.Visible = True : End If
  276. If TextBox45.Text <> "0" Then : TextBox45.Visible = True : Label36.Visible = True : End If
  277. If TextBox46.Text <> "0" Then : TextBox46.Visible = True : Label37.Visible = True : End If
  278. If TextBox47.Text <> "0" Then : TextBox47.Visible = True : Label38.Visible = True : End If
  279. If TextBox48.Text <> "0" Then : TextBox48.Visible = True : Label39.Visible = True : End If
  280. If TextBox49.Text <> "0" Then : TextBox49.Visible = True : End If : If TextBox50.Text <> "0" Then : TextBox50.Visible = True : End If
  281. If TextBox51.Text <> "0" Then : TextBox51.Visible = True : End If : If TextBox52.Text <> "0" Then : TextBox52.Visible = True : End If
  282. If TextBox53.Text <> "0" Then : TextBox53.Visible = True : End If : If TextBox54.Text <> "0" Then : TextBox54.Visible = True : End If
  283. End Sub
  284. Private Sub Set_伏掛五行()
  285. NUM2(1) = 0 : NUM2(2) = 0 : NUM2(3) = 0 : NUM2(4) = 0 : NUM2(5) = 0 : NUM2(6) = 0
  286. For NUM1 = 1 To 6
  287. Dim 條件11 As String = "(地支 = RIGHT('" & TextBox43.Text & "', 1))" : Dim 條件12 As String = "(地支 = RIGHT('" & TextBox44.Text & "', 1))"
  288. Dim 條件13 As String = "(地支 = RIGHT('" & TextBox45.Text & "', 1))" : Dim 條件14 As String = "(地支 = RIGHT('" & TextBox46.Text & "', 1))"
  289. Dim 條件15 As String = "(地支 = RIGHT('" & TextBox47.Text & "', 1))" : Dim 條件16 As String = "(地支 = RIGHT('" & TextBox48.Text & "', 1))"
  290. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  291. If NUM1 = 1 And TextBox43.Text <> "0" Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件11 : NUM2(1) = 1 : End If
  292. If NUM1 = 2 And TextBox44.Text <> "0" Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件12 : NUM2(2) = 1 : End If
  293. If NUM1 = 3 And TextBox45.Text <> "0" Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件13 : NUM2(3) = 1 : End If
  294. If NUM1 = 4 And TextBox46.Text <> "0" Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件14 : NUM2(4) = 1 : End If
  295. If NUM1 = 5 And TextBox47.Text <> "0" Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件15 : NUM2(5) = 1 : End If
  296. If NUM1 = 6 And TextBox48.Text <> "0" Then : SQL1 = "SELECT 五行 FROM 地支五行 WHERE " & 條件16 : NUM2(6) = 1 : End If
  297. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  298. If dr1.Read() Then
  299. If NUM1 = 1 And NUM2(1) = 1 Then : TextBox55.Text = dr1("五行").ToString : End If : If NUM1 = 2 And NUM2(2) = 1 Then : TextBox56.Text = dr1("五行").ToString : End If
  300. If NUM1 = 3 And NUM2(3) = 1 Then : TextBox57.Text = dr1("五行").ToString : End If : If NUM1 = 4 And NUM2(4) = 1 Then : TextBox58.Text = dr1("五行").ToString : End If
  301. If NUM1 = 5 And NUM2(5) = 1 Then : TextBox59.Text = dr1("五行").ToString : End If : If NUM1 = 6 And NUM2(6) = 1 Then : TextBox60.Text = dr1("五行").ToString : End If
  302. End If
  303. conn1.Close() : dr1.Close()
  304. Next
  305. End Sub
  306. Private Sub Set_月建月破()
  307. If Label27.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox61.Text = "月建" : TextBox61.Visible = True : End If
  308. If Label28.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox67.Text = "月建" : TextBox67.Visible = True : End If
  309. If Label29.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox73.Text = "月建" : TextBox73.Visible = True : End If
  310. If Label30.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox79.Text = "月建" : TextBox79.Visible = True : End If
  311. If Label31.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox85.Text = "月建" : TextBox85.Visible = True : End If
  312. If Label32.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox91.Text = "月建" : TextBox91.Visible = True : End If
  313. For NUM1 = 1 To 6
  314. Dim 條件17 As String = "(地支對衝 = '" & Label27.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  315. Dim 條件18 As String = "(地支對衝 = '" & Label28.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  316. Dim 條件19 As String = "(地支對衝 = '" & Label29.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  317. Dim 條件20 As String = "(地支對衝 = '" & Label30.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  318. Dim 條件21 As String = "(地支對衝 = '" & Label31.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  319. Dim 條件22 As String = "(地支對衝 = '" & Label32.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  320. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  321. If NUM1 = 1 And Label27.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then
  322. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件17 : cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  323. If dr1.Read() Then
  324. If NUM1 = 1 Then : TextBox61.Text = dr1("月破").ToString : TextBox61.Visible = True : End If
  325. End If
  326. End If
  327. If NUM1 = 2 And Label28.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then
  328. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件18 : cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  329. If dr1.Read() Then
  330. If NUM1 = 2 Then : TextBox67.Text = dr1("月破").ToString : TextBox67.Visible = True : End If
  331. End If
  332. End If
  333. If NUM1 = 3 And Label29.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then
  334. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件19 : cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  335. If dr1.Read() Then
  336. If NUM1 = 3 Then : TextBox73.Text = dr1("月破").ToString : TextBox73.Visible = True : End If
  337. End If
  338. End If
  339. If NUM1 = 4 And Label30.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then
  340. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件20 : cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  341. If dr1.Read() Then
  342. If NUM1 = 4 Then : TextBox79.Text = dr1("月破").ToString : TextBox79.Visible = True : End If
  343. End If
  344. End If
  345. If NUM1 = 5 And Label31.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then
  346. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件21 : cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  347. If dr1.Read() Then
  348. If NUM1 = 5 Then : TextBox85.Text = dr1("月破").ToString : TextBox85.Visible = True : End If
  349. End If
  350. End If
  351. If NUM1 = 6 And Label32.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then
  352. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件22 : cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  353. If dr1.Read() Then
  354. If NUM1 = 6 Then : TextBox91.Text = dr1("月破").ToString : TextBox91.Visible = True : End If
  355. End If
  356. End If
  357. conn1.Close() : dr1.Close()
  358. Next
  359. End Sub
  360. Private Sub Set_旬空()
  361. If Label27.Text = TextBox97.Text Then : TextBox62.Text = "旬空" : TextBox62.Visible = True : Else
  362. If Label27.Text = TextBox98.Text Then : TextBox62.Text = "旬空" : TextBox62.Visible = True : End If : End If
  363. If Label28.Text = TextBox97.Text Then : TextBox68.Text = "旬空" : TextBox68.Visible = True : Else
  364. If Label28.Text = TextBox98.Text Then : TextBox68.Text = "旬空" : TextBox68.Visible = True : End If : End If
  365. If Label29.Text = TextBox97.Text Then : TextBox74.Text = "旬空" : TextBox74.Visible = True : Else
  366. If Label29.Text = TextBox98.Text Then : TextBox74.Text = "旬空" : TextBox74.Visible = True : End If : End If
  367. If Label30.Text = TextBox97.Text Then : TextBox80.Text = "旬空" : TextBox80.Visible = True : Else
  368. If Label30.Text = TextBox98.Text Then : TextBox80.Text = "旬空" : TextBox80.Visible = True : End If : End If
  369. If Label31.Text = TextBox97.Text Then : TextBox86.Text = "旬空" : TextBox86.Visible = True : Else
  370. If Label31.Text = TextBox98.Text Then : TextBox86.Text = "旬空" : TextBox86.Visible = True : End If : End If
  371. If Label32.Text = TextBox97.Text Then : TextBox92.Text = "旬空" : TextBox92.Visible = True : Else
  372. If Label32.Text = TextBox98.Text Then : TextBox92.Text = "旬空" : TextBox92.Visible = True : End If : End If
  373. End Sub
  374. Private Sub Set_日建日沖()
  375. If Label27.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox63.Text = "日建" : TextBox63.Visible = True : End If
  376. If Label28.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox69.Text = "日建" : TextBox69.Visible = True : End If
  377. If Label29.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox75.Text = "日建" : TextBox75.Visible = True : End If
  378. If Label30.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox81.Text = "日建" : TextBox81.Visible = True : End If
  379. If Label31.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox87.Text = "日建" : TextBox87.Visible = True : End If
  380. If Label32.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox93.Text = "日建" : TextBox93.Visible = True : End If
  381. For NUM1 = 1 To 6
  382. Dim 條件23 As String = "(地支對衝 = '" & Label27.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  383. Dim 條件24 As String = "(地支對衝 = '" & Label28.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  384. Dim 條件25 As String = "(地支對衝 = '" & Label29.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  385. Dim 條件26 As String = "(地支對衝 = '" & Label30.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  386. Dim 條件27 As String = "(地支對衝 = '" & Label31.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  387. Dim 條件28 As String = "(地支對衝 = '" & Label32.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  388. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  389. If NUM1 = 1 And Label27.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件23 : End If
  390. If NUM1 = 2 And Label28.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件24 : End If
  391. If NUM1 = 3 And Label29.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件25 : End If
  392. If NUM1 = 4 And Label30.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件26 : End If
  393. If NUM1 = 5 And Label31.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件27 : End If
  394. If NUM1 = 6 And Label32.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件28 : End If
  395. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  396. If dr1.Read() Then
  397. If NUM1 = 1 Then : TextBox63.Text = dr1("日衝").ToString : TextBox63.Visible = True : End If
  398. If NUM1 = 2 Then : TextBox69.Text = dr1("日衝").ToString : TextBox69.Visible = True : End If
  399. If NUM1 = 3 Then : TextBox75.Text = dr1("日衝").ToString : TextBox75.Visible = True : End If
  400. If NUM1 = 4 Then : TextBox81.Text = dr1("日衝").ToString : TextBox81.Visible = True : End If
  401. If NUM1 = 5 Then : TextBox87.Text = dr1("日衝").ToString : TextBox87.Visible = True : End If
  402. If NUM1 = 6 Then : TextBox93.Text = dr1("日衝").ToString : TextBox93.Visible = True : End If
  403. End If
  404. conn1.Close() : dr1.Close()
  405. Next
  406. End Sub
  407. Private Sub Set_伏卦月建月破()
  408. If TextBox43.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox64.Text = "月建" : TextBox64.Visible = True : End If
  409. If TextBox44.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox70.Text = "月建" : TextBox70.Visible = True : End If
  410. If TextBox45.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox76.Text = "月建" : TextBox76.Visible = True : End If
  411. If TextBox46.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox82.Text = "月建" : TextBox82.Visible = True : End If
  412. If TextBox47.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox88.Text = "月建" : TextBox88.Visible = True : End If
  413. If TextBox48.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox94.Text = "月建" : TextBox94.Visible = True : End If
  414. For NUM1 = 1 To 6
  415. Dim 條件29 As String = "(地支對衝 = '" & TextBox43.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  416. Dim 條件30 As String = "(地支對衝 = '" & TextBox44.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  417. Dim 條件31 As String = "(地支對衝 = '" & TextBox45.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  418. Dim 條件32 As String = "(地支對衝 = '" & TextBox46.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  419. Dim 條件33 As String = "(地支對衝 = '" & TextBox47.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  420. Dim 條件34 As String = "(地支對衝 = '" & TextBox48.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  421. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  422. If NUM1 = 1 And TextBox43.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件29 : End If
  423. If NUM1 = 2 And TextBox44.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件30 : End If
  424. If NUM1 = 3 And TextBox45.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件31 : End If
  425. If NUM1 = 4 And TextBox46.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件32 : End If
  426. If NUM1 = 5 And TextBox47.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件33 : End If
  427. If NUM1 = 6 And TextBox48.Text <> Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : SQL1 = "SELECT 月破 FROM 日月衝破 WHERE " & 條件34 : End If
  428. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  429. If dr1.Read() Then
  430. If NUM1 = 1 Then : TextBox64.Text = dr1("月破").ToString : TextBox64.Visible = True : End If
  431. If NUM1 = 2 Then : TextBox70.Text = dr1("月破").ToString : TextBox70.Visible = True : End If
  432. If NUM1 = 3 Then : TextBox76.Text = dr1("月破").ToString : TextBox76.Visible = True : End If
  433. If NUM1 = 4 Then : TextBox82.Text = dr1("月破").ToString : TextBox82.Visible = True : End If
  434. If NUM1 = 5 Then : TextBox88.Text = dr1("月破").ToString : TextBox88.Visible = True : End If
  435. If NUM1 = 6 Then : TextBox94.Text = dr1("月破").ToString : TextBox94.Visible = True : End If
  436. End If
  437. conn1.Close() : dr1.Close()
  438. Next
  439. End Sub
  440. Private Sub Set_伏卦旬空()
  441. If TextBox43.Text = TextBox97.Text Then : TextBox65.Text = "旬空" : TextBox65.Visible = True : Else
  442. If TextBox43.Text = TextBox98.Text Then : TextBox65.Text = "旬空" : TextBox65.Visible = True : End If : End If
  443. If TextBox44.Text = TextBox97.Text Then : TextBox71.Text = "旬空" : TextBox71.Visible = True : Else
  444. If TextBox44.Text = TextBox98.Text Then : TextBox71.Text = "旬空" : TextBox71.Visible = True : End If : End If
  445. If TextBox45.Text = TextBox97.Text Then : TextBox77.Text = "旬空" : TextBox77.Visible = True : Else
  446. If TextBox45.Text = TextBox98.Text Then : TextBox77.Text = "旬空" : TextBox77.Visible = True : End If : End If
  447. If TextBox46.Text = TextBox97.Text Then : TextBox83.Text = "旬空" : TextBox83.Visible = True : Else
  448. If TextBox46.Text = TextBox98.Text Then : TextBox83.Text = "旬空" : TextBox83.Visible = True : End If : End If
  449. If TextBox47.Text = TextBox97.Text Then : TextBox89.Text = "旬空" : TextBox89.Visible = True : Else
  450. If TextBox47.Text = TextBox98.Text Then : TextBox89.Text = "旬空" : TextBox89.Visible = True : End If : End If
  451. If TextBox48.Text = TextBox97.Text Then : TextBox95.Text = "旬空" : TextBox95.Visible = True : Else
  452. If TextBox48.Text = TextBox98.Text Then : TextBox95.Text = "旬空" : TextBox95.Visible = True : End If : End If
  453. End Sub
  454. Private Sub Set_伏卦日建日沖()
  455. If TextBox43.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox66.Text = "日建" : TextBox66.Visible = True : End If
  456. If TextBox44.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox72.Text = "日建" : TextBox72.Visible = True : End If
  457. If TextBox45.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox78.Text = "日建" : TextBox78.Visible = True : End If
  458. If TextBox46.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox84.Text = "日建" : TextBox84.Visible = True : End If
  459. If TextBox47.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox90.Text = "日建" : TextBox90.Visible = True : End If
  460. If TextBox48.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox96.Text = "日建" : TextBox96.Visible = True : End If
  461. For NUM1 = 1 To 6
  462. Dim 條件35 As String = "(地支對衝 = '" & TextBox43.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  463. Dim 條件36 As String = "(地支對衝 = '" & TextBox44.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  464. Dim 條件37 As String = "(地支對衝 = '" & TextBox45.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  465. Dim 條件38 As String = "(地支對衝 = '" & TextBox46.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  466. Dim 條件39 As String = "(地支對衝 = '" & TextBox47.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  467. Dim 條件40 As String = "(地支對衝 = '" & TextBox48.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  468. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  469. If NUM1 = 1 And TextBox43.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件35 : End If
  470. If NUM1 = 2 And TextBox44.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件36 : End If
  471. If NUM1 = 3 And TextBox45.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件37 : End If
  472. If NUM1 = 4 And TextBox46.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件38 : End If
  473. If NUM1 = 5 And TextBox47.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件39 : End If
  474. If NUM1 = 6 And TextBox48.Text <> Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE " & 條件40 : End If
  475. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  476. If dr1.Read() Then
  477. If NUM1 = 1 Then : TextBox66.Text = dr1("日衝").ToString : TextBox66.Visible = True : End If
  478. If NUM1 = 2 Then : TextBox72.Text = dr1("日衝").ToString : TextBox72.Visible = True : End If
  479. If NUM1 = 3 Then : TextBox78.Text = dr1("日衝").ToString : TextBox78.Visible = True : End If
  480. If NUM1 = 4 Then : TextBox84.Text = dr1("日衝").ToString : TextBox84.Visible = True : End If
  481. If NUM1 = 5 Then : TextBox90.Text = dr1("日衝").ToString : TextBox90.Visible = True : End If
  482. If NUM1 = 6 Then : TextBox96.Text = dr1("日衝").ToString : TextBox96.Visible = True : End If
  483. End If
  484. conn1.Close() : dr1.Close()
  485. Next
  486. End Sub
  487. Private Sub Set_化卦內容()
  488. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  489. SQL1 = "SELECT 爻數 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  490. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader : If dr1.Read() Then : TextBox132.Text = dr1("爻數").ToString : End If : conn1.Close() : dr1.Close()
  491. If TextBox132.Text = "1" Then : Label40.Visible = True
  492. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  493. SQL1 = "SELECT 化六親 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  494. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  495. If dr1.Read() Then : TextBox108.Text = dr1("化六親").ToString : End If : conn1.Close() : dr1.Close() : TextBox108.Visible = True
  496. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  497. SQL1 = "SELECT 化地支 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  498. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  499. If dr1.Read() Then : TextBox102.Text = dr1("化地支").ToString : End If : conn1.Close() : dr1.Close() : TextBox102.Visible = True
  500. If TextBox102.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox114.Text = "月建" : TextBox114.Visible = True : Else
  501. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  502. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox102.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  503. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  504. If dr1.Read() Then : TextBox114.Text = dr1("月破").ToString : TextBox114.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  505. If TextBox102.Text = TextBox97.Text Then : TextBox120.Text = "旬空" : TextBox120.Visible = True : Else
  506. If TextBox102.Text = TextBox98.Text Then : TextBox120.Text = "旬空" : TextBox120.Visible = True : End If : End If
  507. If TextBox102.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox126.Text = "日建" : TextBox126.Visible = True : Else
  508. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  509. SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox102.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  510. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  511. If dr1.Read() Then : TextBox126.Text = dr1("日衝").ToString : TextBox126.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  512. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  513. SQL1 = "SELECT 五行 FROM 地支五行 WHERE (地支 = RIGHT('" & TextBox102.Text & "', 1))"
  514. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader : If dr1.Read() Then : TextBox133.Text = dr1("五行").ToString
  515. TextBox133.Visible = True : End If : conn1.Close() : dr1.Close()
  516. Else
  517. If TextBox132.Text = "2" Then : Label41.Visible = True
  518. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  519. SQL1 = "SELECT 化六親 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  520. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  521. If dr1.Read() Then : TextBox109.Text = dr1("化六親").ToString : End If : conn1.Close() : dr1.Close() : TextBox109.Visible = True
  522. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  523. SQL1 = "SELECT 化地支 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  524. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  525. If dr1.Read() Then : TextBox103.Text = dr1("化地支").ToString : End If : conn1.Close() : dr1.Close() : TextBox103.Visible = True
  526. If TextBox103.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox115.Text = "月建" : TextBox115.Visible = True : Else
  527. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  528. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox103.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  529. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  530. If dr1.Read() Then : TextBox115.Text = dr1("月破").ToString : TextBox115.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  531. If TextBox103.Text = TextBox97.Text Then : TextBox121.Text = "旬空" : TextBox121.Visible = True : Else
  532. If TextBox103.Text = TextBox98.Text Then : TextBox121.Text = "旬空" : TextBox121.Visible = True : End If : End If
  533. If TextBox103.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox127.Text = "日建" : TextBox127.Visible = True : Else
  534. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  535. SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox103.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  536. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  537. If dr1.Read() Then : TextBox127.Text = dr1("日衝").ToString : TextBox127.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  538. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  539. SQL1 = "SELECT 五行 FROM 地支五行 WHERE (地支 = RIGHT('" & TextBox103.Text & "', 1))"
  540. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader : If dr1.Read() Then : TextBox134.Text = dr1("五行").ToString
  541. TextBox134.Visible = True : End If : conn1.Close() : dr1.Close()
  542. Else
  543. If TextBox132.Text = "3" Then : Label42.Visible = True
  544. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  545. SQL1 = "SELECT 化六親 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  546. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  547. If dr1.Read() Then : TextBox110.Text = dr1("化六親").ToString : End If : conn1.Close() : dr1.Close() : TextBox110.Visible = True
  548. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  549. SQL1 = "SELECT 化地支 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  550. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  551. If dr1.Read() Then : TextBox104.Text = dr1("化地支").ToString : End If : conn1.Close() : dr1.Close() : TextBox104.Visible = True
  552. If TextBox104.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox116.Text = "月建" : TextBox116.Visible = True : Else
  553. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  554. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox104.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  555. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  556. If dr1.Read() Then : TextBox116.Text = dr1("月破").ToString : TextBox116.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  557. If TextBox104.Text = TextBox97.Text Then : TextBox122.Text = "旬空" : TextBox122.Visible = True : Else
  558. If TextBox104.Text = TextBox98.Text Then : TextBox122.Text = "旬空" : TextBox122.Visible = True : End If : End If
  559. If TextBox104.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox128.Text = "日建" : TextBox128.Visible = True : Else
  560. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  561. SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox104.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  562. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  563. If dr1.Read() Then : TextBox128.Text = dr1("日衝").ToString : TextBox128.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  564. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  565. SQL1 = "SELECT 五行 FROM 地支五行 WHERE (地支 = RIGHT('" & TextBox104.Text & "', 1))"
  566. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader : If dr1.Read() Then : TextBox135.Text = dr1("五行").ToString
  567. TextBox135.Visible = True : End If : conn1.Close() : dr1.Close()
  568. Else
  569. If TextBox132.Text = "4" Then : Label43.Visible = True
  570. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  571. SQL1 = "SELECT 化六親 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  572. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  573. If dr1.Read() Then : TextBox111.Text = dr1("化六親").ToString : End If : conn1.Close() : dr1.Close() : TextBox111.Visible = True
  574. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  575. SQL1 = "SELECT 化地支 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  576. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  577. If dr1.Read() Then : TextBox105.Text = dr1("化地支").ToString : End If : conn1.Close() : dr1.Close() : TextBox105.Visible = True
  578. If TextBox105.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox117.Text = "月建" : TextBox117.Visible = True : Else
  579. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  580. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox105.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  581. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  582. If dr1.Read() Then : TextBox117.Text = dr1("月破").ToString : TextBox117.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  583. If TextBox105.Text = TextBox97.Text Then : TextBox123.Text = "旬空" : TextBox123.Visible = True : Else
  584. If TextBox105.Text = TextBox98.Text Then : TextBox123.Text = "旬空" : TextBox123.Visible = True : End If : End If
  585. If TextBox105.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox129.Text = "日建" : TextBox129.Visible = True : Else
  586. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  587. SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox105.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  588. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  589. If dr1.Read() Then : TextBox129.Text = dr1("日衝").ToString : TextBox129.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  590. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  591. SQL1 = "SELECT 五行 FROM 地支五行 WHERE (地支 = RIGHT('" & TextBox105.Text & "', 1))"
  592. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader : If dr1.Read() Then : TextBox136.Text = dr1("五行").ToString
  593. TextBox136.Visible = True : End If : conn1.Close() : dr1.Close()
  594. Else
  595. If TextBox132.Text = "5" Then : Label44.Visible = True
  596. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  597. SQL1 = "SELECT 化六親 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  598. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  599. If dr1.Read() Then : TextBox112.Text = dr1("化六親").ToString : End If : conn1.Close() : dr1.Close() : TextBox112.Visible = True
  600. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  601. SQL1 = "SELECT 化地支 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  602. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  603. If dr1.Read() Then : TextBox106.Text = dr1("化地支").ToString : End If : conn1.Close() : dr1.Close() : TextBox106.Visible = True
  604. If TextBox106.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox118.Text = "月建" : TextBox118.Visible = True : Else
  605. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  606. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox106.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  607. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  608. If dr1.Read() Then : TextBox118.Text = dr1("月破").ToString : TextBox118.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  609. If TextBox106.Text = TextBox97.Text Then : TextBox124.Text = "旬空" : TextBox124.Visible = True : Else
  610. If TextBox106.Text = TextBox98.Text Then : TextBox124.Text = "旬空" : TextBox124.Visible = True : End If : End If
  611. If TextBox106.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox130.Text = "日建" : TextBox130.Visible = True : Else
  612. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  613. SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox106.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  614. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  615. If dr1.Read() Then : TextBox130.Text = dr1("日衝").ToString : TextBox130.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  616. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  617. SQL1 = "SELECT 五行 FROM 地支五行 WHERE (地支 = RIGHT('" & TextBox106.Text & "', 1))"
  618. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader : If dr1.Read() Then : TextBox137.Text = dr1("五行").ToString
  619. TextBox137.Visible = True : End If : conn1.Close() : dr1.Close()
  620. Else
  621. If TextBox132.Text = "6" Then : Label45.Visible = True
  622. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  623. SQL1 = "SELECT 化六親 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  624. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  625. If dr1.Read() Then : TextBox113.Text = dr1("化六親").ToString : End If : conn1.Close() : dr1.Close() : TextBox113.Visible = True
  626. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  627. SQL1 = "SELECT 化地支 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  628. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  629. If dr1.Read() Then : TextBox107.Text = dr1("化地支").ToString : End If : conn1.Close() : dr1.Close() : TextBox107.Visible = True
  630. If TextBox107.Text = Microsoft.VisualBasic.Right(TextBox2.Text, 1) Then : TextBox119.Text = "月建" : TextBox119.Visible = True : Else
  631. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  632. SQL1 = "SELECT 月破 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox107.Text + Microsoft.VisualBasic.Right(TextBox2.Text, 1) & "')"
  633. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  634. If dr1.Read() Then : TextBox119.Text = dr1("月破").ToString : TextBox119.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  635. If TextBox107.Text = TextBox97.Text Then : TextBox125.Text = "旬空" : TextBox125.Visible = True : Else
  636. If TextBox107.Text = TextBox98.Text Then : TextBox125.Text = "旬空" : TextBox125.Visible = True : End If : End If
  637. If TextBox107.Text = Microsoft.VisualBasic.Right(TextBox4.Text, 1) Then : TextBox131.Text = "日建" : TextBox131.Visible = True : Else
  638. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  639. SQL1 = "SELECT 日衝 FROM 日月衝破 WHERE (地支對衝 = '" & TextBox107.Text + Microsoft.VisualBasic.Right(TextBox4.Text, 1) & "')"
  640. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  641. If dr1.Read() Then : TextBox131.Text = dr1("日衝").ToString : TextBox131.Visible = True : End If : conn1.Close() : dr1.Close() : End If
  642. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  643. SQL1 = "SELECT 五行 FROM 地支五行 WHERE (地支 = RIGHT('" & TextBox107.Text & "', 1))"
  644. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader : If dr1.Read() Then : TextBox138.Text = dr1("五行").ToString
  645. TextBox138.Visible = True : End If : conn1.Close() : dr1.Close()
  646. End If : End If : End If : End If : End If : End If
  647. End Sub
  648. Private Sub Set_周易經文()
  649. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  650. SQL1 = "SELECT 經文, 篆曰, 象曰 FROM 周易本文 WHERE (卦名 = '" & TextBox24.Text & "')"
  651. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  652. If dr1.Read() Then
  653. TextBox169.Text = dr1("經文").ToString : TextBox170.Text = dr1("篆曰").ToString : TextBox171.Text = dr1("象曰").ToString
  654. End If
  655. conn1.Close() : dr1.Close()
  656. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  657. SQL1 = "SELECT 本卦爻辭, 本卦爻象, 化卦爻辭, 化卦爻象 FROM 卜筮化卦 WHERE (卦數 = '" & ComboBox3.Text + ComboBox2.Text + ComboBox1.Text & "')"
  658. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  659. If dr1.Read() Then
  660. TextBox174.Text = dr1("本卦爻辭").ToString : TextBox175.Text = dr1("本卦爻象").ToString : TextBox176.Text = dr1("化卦爻辭").ToString
  661. TextBox177.Text = dr1("化卦爻象").ToString
  662. End If
  663. conn1.Close() : dr1.Close()
  664. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  665. SQL1 = "SELECT 易林 FROM 焦氏易林注 WHERE 主卦 LIKE '" & TextBox24.Text & "' AND 化卦 LIKE '" & TextBox100.Text & "' "
  666. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  667. If dr1.Read() Then
  668. TextBox240.Text = dr1("易林").ToString
  669. End If
  670. conn1.Close() : dr1.Close()
  671. End Sub
  672. Private Sub Set_六沖六和()
  673. For NUM1 = 1 To 2
  674. Dim 條件41 As String = "(卦名 = '" & TextBox24.Text & "')" : Dim 條件42 As String = "(卦名 = '" & TextBox100.Text & "')"
  675. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  676. If NUM1 = 1 Then : SQL1 = "SELECT 和衝 FROM 八卦六親 WHERE " & 條件41 : End If : If NUM1 = 2 Then : SQL1 = "SELECT 和衝 FROM 八卦六親 WHERE " & 條件42 : End If
  677. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  678. If dr1.Read() Then
  679. If NUM1 = 1 Then : TextBox226.Text = dr1("和衝").ToString : End If : If NUM1 = 2 Then : TextBox227.Text = dr1("和衝").ToString : End If
  680. End If
  681. conn1.Close() : dr1.Close()
  682. Next
  683. If TextBox226.Text <> "0" Then : TextBox226.Visible = True : End If
  684. If TextBox227.Text <> "0" Then : TextBox227.Visible = True : End If
  685. End Sub
  686. Private Sub Set_用原忌仇()
  687. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  688. SQL1 = "SELECT 原神, 仇神, 忌神, 原神五行, 仇神五行, 忌神五行 FROM 用原仇忌 WHERE (用神 = '" & ComboBox5.Text + ComboBox4.Text & "')"
  689. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  690. If dr1.Read() Then
  691. TextBox139.Text = dr1("原神").ToString : TextBox140.Text = dr1("仇神").ToString : TextBox141.Text = dr1("忌神").ToString
  692. TextBox142.Text = dr1("原神五行").ToString : TextBox143.Text = dr1("仇神五行").ToString : TextBox144.Text = dr1("忌神五行").ToString
  693. End If
  694. conn1.Close() : dr1.Close()
  695. End Sub
  696. Private Sub Set_用神五行()
  697. If ComboBox5.Text = "火" Then
  698. TextBox157.Text = "寅" : TextBox158.Text = "卯" : TextBox159.Text = "辰" : TextBox160.Text = "巳" : TextBox161.Text = "午" : TextBox162.Text = "未"
  699. TextBox163.Text = "申" : TextBox164.Text = "酉" : TextBox165.Text = "戌" : TextBox166.Text = "亥" : TextBox167.Text = "子" : TextBox168.Text = "丑"
  700. Else
  701. If ComboBox5.Text = "金" Then
  702. TextBox157.Text = "巳" : TextBox158.Text = "午" : TextBox159.Text = "未" : TextBox160.Text = "申" : TextBox161.Text = "酉" : TextBox162.Text = "戌"
  703. TextBox163.Text = "亥" : TextBox164.Text = "子" : TextBox165.Text = "丑" : TextBox166.Text = "寅" : TextBox167.Text = "卯" : TextBox168.Text = "辰"
  704. Else
  705. If ComboBox5.Text = "水" Then
  706. TextBox157.Text = "申" : TextBox158.Text = "酉" : TextBox159.Text = "戌" : TextBox160.Text = "亥" : TextBox161.Text = "子" : TextBox162.Text = "丑"
  707. TextBox163.Text = "寅" : TextBox164.Text = "卯" : TextBox165.Text = "辰" : TextBox166.Text = "巳" : TextBox167.Text = "午" : TextBox168.Text = "未"
  708. Else
  709. If ComboBox5.Text = "木" Then
  710. TextBox157.Text = "亥" : TextBox158.Text = "子" : TextBox159.Text = "丑" : TextBox160.Text = "寅" : TextBox161.Text = "卯" : TextBox162.Text = "辰"
  711. TextBox163.Text = "巳" : TextBox164.Text = "午" : TextBox165.Text = "未" : TextBox166.Text = "申" : TextBox167.Text = "酉" : TextBox168.Text = "戌"
  712. Else
  713. If ComboBox5.Text = "土" Then
  714. TextBox157.Text = "申" : TextBox158.Text = "酉" : TextBox159.Text = "戌" : TextBox160.Text = "亥" : TextBox161.Text = "子" : TextBox162.Text = "丑"
  715. TextBox163.Text = "寅" : TextBox164.Text = "卯" : TextBox165.Text = "辰" : TextBox166.Text = "巳" : TextBox167.Text = "午" : TextBox168.Text = "未"
  716. End If : End If : End If : End If : End If
  717. End Sub
  718. Private Sub Set_格式設定2()
  719. If Label27.Text = TextBox145.Text Then : TextBox184.Text = Label50.Text : Else
  720. If Label27.Text = TextBox146.Text Then : TextBox184.Text = Label51.Text : Else
  721. If Label27.Text = TextBox147.Text Then : TextBox184.Text = Label52.Text : Else
  722. If Label27.Text = TextBox148.Text Then : TextBox184.Text = Label61.Text : Else
  723. If Label27.Text = TextBox149.Text Then : TextBox184.Text = Label53.Text : Else
  724. If Label27.Text = TextBox150.Text Then : TextBox184.Text = Label56.Text : Else
  725. If Label27.Text = TextBox151.Text Then : TextBox184.Text = Label57.Text : Else
  726. If Label27.Text = TextBox152.Text Then : TextBox184.Text = Label58.Text : Else
  727. If Label27.Text = TextBox153.Text Then : TextBox184.Text = Label59.Text : Else
  728. If Label27.Text = TextBox154.Text Then : TextBox184.Text = Label60.Text : Else
  729. If Label27.Text = TextBox155.Text Then : TextBox184.Text = Label62.Text : Else
  730. If Label27.Text = TextBox156.Text Then : TextBox184.Text = Label63.Text
  731. End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If
  732. If Label28.Text = TextBox145.Text Then : TextBox185.Text = Label50.Text : Else
  733. If Label28.Text = TextBox146.Text Then : TextBox185.Text = Label51.Text : Else
  734. If Label28.Text = TextBox147.Text Then : TextBox185.Text = Label52.Text : Else
  735. If Label28.Text = TextBox148.Text Then : TextBox185.Text = Label61.Text : Else
  736. If Label28.Text = TextBox149.Text Then : TextBox185.Text = Label53.Text : Else
  737. If Label28.Text = TextBox150.Text Then : TextBox185.Text = Label56.Text : Else
  738. If Label28.Text = TextBox151.Text Then : TextBox185.Text = Label57.Text : Else
  739. If Label28.Text = TextBox152.Text Then : TextBox185.Text = Label58.Text : Else
  740. If Label28.Text = TextBox153.Text Then : TextBox185.Text = Label59.Text : Else
  741. If Label28.Text = TextBox154.Text Then : TextBox185.Text = Label60.Text : Else
  742. If Label28.Text = TextBox155.Text Then : TextBox185.Text = Label62.Text : Else
  743. If Label28.Text = TextBox156.Text Then : TextBox185.Text = Label63.Text
  744. End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If
  745. If Label29.Text = TextBox145.Text Then : TextBox186.Text = Label50.Text : Else
  746. If Label29.Text = TextBox146.Text Then : TextBox186.Text = Label51.Text : Else
  747. If Label29.Text = TextBox147.Text Then : TextBox186.Text = Label52.Text : Else
  748. If Label29.Text = TextBox148.Text Then : TextBox186.Text = Label61.Text : Else
  749. If Label29.Text = TextBox149.Text Then : TextBox186.Text = Label53.Text : Else
  750. If Label29.Text = TextBox150.Text Then : TextBox186.Text = Label56.Text : Else
  751. If Label29.Text = TextBox151.Text Then : TextBox186.Text = Label57.Text : Else
  752. If Label29.Text = TextBox152.Text Then : TextBox186.Text = Label58.Text : Else
  753. If Label29.Text = TextBox153.Text Then : TextBox186.Text = Label59.Text : Else
  754. If Label29.Text = TextBox154.Text Then : TextBox186.Text = Label60.Text : Else
  755. If Label29.Text = TextBox155.Text Then : TextBox186.Text = Label62.Text : Else
  756. If Label29.Text = TextBox156.Text Then : TextBox186.Text = Label63.Text
  757. End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If
  758. If Label30.Text = TextBox145.Text Then : TextBox189.Text = Label50.Text : Else
  759. If Label30.Text = TextBox146.Text Then : TextBox189.Text = Label51.Text : Else
  760. If Label30.Text = TextBox147.Text Then : TextBox189.Text = Label52.Text : Else
  761. If Label30.Text = TextBox148.Text Then : TextBox189.Text = Label61.Text : Else
  762. If Label30.Text = TextBox149.Text Then : TextBox189.Text = Label53.Text : Else
  763. If Label30.Text = TextBox150.Text Then : TextBox189.Text = Label56.Text : Else
  764. If Label30.Text = TextBox151.Text Then : TextBox189.Text = Label57.Text : Else
  765. If Label30.Text = TextBox152.Text Then : TextBox189.Text = Label58.Text : Else
  766. If Label30.Text = TextBox153.Text Then : TextBox189.Text = Label59.Text : Else
  767. If Label30.Text = TextBox154.Text Then : TextBox189.Text = Label60.Text : Else
  768. If Label30.Text = TextBox155.Text Then : TextBox189.Text = Label62.Text : Else
  769. If Label30.Text = TextBox156.Text Then : TextBox189.Text = Label63.Text
  770. End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If
  771. If Label31.Text = TextBox145.Text Then : TextBox191.Text = Label50.Text : Else
  772. If Label31.Text = TextBox146.Text Then : TextBox191.Text = Label51.Text : Else
  773. If Label31.Text = TextBox147.Text Then : TextBox191.Text = Label52.Text : Else
  774. If Label31.Text = TextBox148.Text Then : TextBox191.Text = Label61.Text : Else
  775. If Label31.Text = TextBox149.Text Then : TextBox191.Text = Label53.Text : Else
  776. If Label31.Text = TextBox150.Text Then : TextBox191.Text = Label56.Text : Else
  777. If Label31.Text = TextBox151.Text Then : TextBox191.Text = Label57.Text : Else
  778. If Label31.Text = TextBox152.Text Then : TextBox191.Text = Label58.Text : Else
  779. If Label31.Text = TextBox153.Text Then : TextBox191.Text = Label59.Text : Else
  780. If Label31.Text = TextBox154.Text Then : TextBox191.Text = Label60.Text : Else
  781. If Label31.Text = TextBox155.Text Then : TextBox191.Text = Label62.Text : Else
  782. If Label31.Text = TextBox156.Text Then : TextBox191.Text = Label63.Text
  783. End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If
  784. If Label32.Text = TextBox145.Text Then : TextBox192.Text = Label50.Text : Else
  785. If Label32.Text = TextBox146.Text Then : TextBox192.Text = Label51.Text : Else
  786. If Label32.Text = TextBox147.Text Then : TextBox192.Text = Label52.Text : Else
  787. If Label32.Text = TextBox148.Text Then : TextBox192.Text = Label61.Text : Else
  788. If Label32.Text = TextBox149.Text Then : TextBox192.Text = Label53.Text : Else
  789. If Label32.Text = TextBox150.Text Then : TextBox192.Text = Label56.Text : Else
  790. If Label32.Text = TextBox151.Text Then : TextBox192.Text = Label57.Text : Else
  791. If Label32.Text = TextBox152.Text Then : TextBox192.Text = Label58.Text : Else
  792. If Label32.Text = TextBox153.Text Then : TextBox192.Text = Label59.Text : Else
  793. If Label32.Text = TextBox154.Text Then : TextBox192.Text = Label60.Text : Else
  794. If Label32.Text = TextBox155.Text Then : TextBox192.Text = Label62.Text : Else
  795. If Label32.Text = TextBox156.Text Then : TextBox192.Text = Label63.Text
  796. End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If : End If
  797. If TextBox102.Visible = True And TextBox102.Text = TextBox145.Text Then : TextBox193.Text = Label50.Text : TextBox193.Visible = True : Else
  798. If TextBox102.Visible = True And TextBox102.Text = TextBox153.Text Then : TextBox193.Text = Label59.Text : TextBox193.Visible = True : Else
  799. If TextBox102.Visible = True And TextBox102.Text = TextBox154.Text Then : TextBox193.Text = Label60.Text : TextBox193.Visible = True
  800. End If : End If : End If
  801. If TextBox103.Visible = True And TextBox103.Text = TextBox145.Text Then : TextBox194.Text = Label50.Text : TextBox194.Visible = True : Else
  802. If TextBox103.Visible = True And TextBox103.Text = TextBox153.Text Then : TextBox194.Text = Label59.Text : TextBox194.Visible = True : Else
  803. If TextBox103.Visible = True And TextBox103.Text = TextBox154.Text Then : TextBox194.Text = Label60.Text : TextBox194.Visible = True
  804. End If : End If : End If
  805. If TextBox104.Visible = True And TextBox104.Text = TextBox145.Text Then : TextBox195.Text = Label50.Text : TextBox195.Visible = True : Else
  806. If TextBox104.Visible = True And TextBox104.Text = TextBox153.Text Then : TextBox195.Text = Label59.Text : TextBox195.Visible = True : Else
  807. If TextBox104.Visible = True And TextBox104.Text = TextBox154.Text Then : TextBox195.Text = Label60.Text : TextBox195.Visible = True : Else
  808. End If : End If : End If
  809. If TextBox105.Visible = True And TextBox105.Text = TextBox145.Text Then : TextBox196.Text = Label50.Text : TextBox196.Visible = True : Else
  810. If TextBox105.Visible = True And TextBox105.Text = TextBox153.Text Then : TextBox196.Text = Label59.Text : TextBox196.Visible = True : Else
  811. If TextBox105.Visible = True And TextBox105.Text = TextBox154.Text Then : TextBox196.Text = Label60.Text : TextBox196.Visible = True : Else
  812. End If : End If : End If
  813. If TextBox106.Visible = True And TextBox106.Text = TextBox145.Text Then : TextBox197.Text = Label50.Text : TextBox197.Visible = True : Else
  814. If TextBox106.Visible = True And TextBox106.Text = TextBox153.Text Then : TextBox197.Text = Label59.Text : TextBox197.Visible = True : Else
  815. If TextBox106.Visible = True And TextBox106.Text = TextBox154.Text Then : TextBox197.Text = Label60.Text : TextBox197.Visible = True : Else
  816. End If : End If : End If
  817. If TextBox107.Visible = True And TextBox107.Text = TextBox145.Text Then : TextBox198.Text = Label50.Text : TextBox198.Visible = True : Else
  818. If TextBox107.Visible = True And TextBox107.Text = TextBox153.Text Then : TextBox198.Text = Label59.Text : TextBox198.Visible = True : Else
  819. If TextBox107.Visible = True And TextBox107.Text = TextBox154.Text Then : TextBox198.Text = Label60.Text : TextBox198.Visible = True : Else
  820. End If : End If : End If
  821. End Sub
  822. Private Sub Set_貴人爻()
  823. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "甲" Or Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "戊" Then : TextBox199.Text = " 丑未爻--即是日貴人" : End If
  824. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "乙" Or Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "己" Then : TextBox199.Text = " 子申爻--即是日貴人" : End If
  825. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "丙" Or Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "丁" Then : TextBox199.Text = " 酉亥爻--即是日貴人" : End If
  826. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "壬" Or Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "癸" Then : TextBox199.Text = " 卯巳爻--即是日貴人" : End If
  827. If Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "庚" Or Microsoft.VisualBasic.Left(TextBox4.Text, 1) = "辛" Then : TextBox199.Text = " 午寅爻--即是日貴人" : End If
  828. End Sub
  829. Private Sub Set_紀錄清單()
  830. DataGridView1.DataSource = Nothing : ds.Clear()
  831. DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  832. DataGridView1.ColumnHeadersHeight = 25
  833. DataGridView1.AllowUserToAddRows = False
  834. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  835. SQL = "SELECT 流水號, 日期, 卦數一, 卦數二, 卦數三, 用神, 五行, 占事者, 占事, 貴人, 三合, 三刑 FROM 卜卦紀錄 ORDER BY 流水號 DESC"
  836. cmd.Connection = conn : cmd.CommandText = SQL : da.SelectCommand = cmd : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
  837. End Sub
  838. Private Sub 卜卦_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  839. Me.WindowState = 2
  840. TextBox199.Text = "" : TextBox200.Text = "" : TextBox201.Text = ""
  841. DateTimePicker1.Value = Today
  842. set_紀錄清單() : set_萬年曆() : set_萬年曆五行() : set_相氣休囚() : set_六獸() : set_日長生() : set_格式設定() : set_grid()
  843. End Sub
  844. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  845. timeNow = 0
  846. GCM_ERP_SYS.Timer1.Enabled = False
  847. GCM_ERP_SYS.Timer1.Enabled = True
  848. End Sub
  849. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  850. timeNow = 0
  851. GCM_ERP_SYS.Timer1.Enabled = False
  852. GCM_ERP_SYS.Timer1.Enabled = True
  853. End Sub
  854. Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
  855. If e.RowIndex = -1 Then : Else
  856. Set_格式設定()
  857. TextBox182.Text = DataGridView1(0, e.RowIndex).Value.ToString : DateTimePicker1.Text = DataGridView1(1, e.RowIndex).Value.ToString
  858. ComboBox1.Text = DataGridView1(2, e.RowIndex).Value.ToString : ComboBox2.Text = DataGridView1(3, e.RowIndex).Value.ToString
  859. ComboBox3.Text = DataGridView1(4, e.RowIndex).Value.ToString : ComboBox4.Text = DataGridView1(5, e.RowIndex).Value.ToString
  860. ComboBox5.Text = DataGridView1(6, e.RowIndex).Value.ToString : TextBox183.Text = DataGridView1(7, e.RowIndex).Value.ToString
  861. TextBox179.Text = DataGridView1(8, e.RowIndex).Value.ToString : TextBox199.Text = DataGridView1(9, e.RowIndex).Value.ToString
  862. TextBox200.Text = DataGridView1(10, e.RowIndex).Value.ToString : TextBox201.Text = DataGridView1(11, e.RowIndex).Value.ToString
  863. Set_萬年曆() : Set_萬年曆五行() : Set_相氣休囚() : Set_六獸() : Set_日長生()
  864. Set_排掛() : Set_化掛() : Set_裝掛() : Set_掛名() : Set_掛地支五行() : Set_世應伏身() : Set_伏掛五行() : Set_月建月破() : Set_旬空() : Set_日建日沖() : Set_伏卦月建月破()
  865. Set_伏卦旬空() : Set_伏卦日建日沖() : Set_化卦內容() : Set_周易經文() : Set_六沖六和()
  866. Set_用原忌仇() : Set_用神五行() : Set_格式設定2() : Set_貴人爻()
  867. End If
  868. End Sub
  869. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  870. set_格式設定()
  871. If ComboBox1.Text = "" Or ComboBox2.Text = "" Or ComboBox3.Text = "" Then
  872. MsgBox("請輸入卜筮卦數 。")
  873. Else
  874. set_排掛() : set_化掛() : set_裝掛() : set_掛名() : set_掛地支五行() : set_世應伏身() : set_伏掛五行() : set_月建月破() : set_旬空() : set_日建日沖() : set_伏卦月建月破()
  875. set_伏卦旬空() : set_伏卦日建日沖() : set_化卦內容() : set_周易經文() : set_六沖六和()
  876. set_用原忌仇() : set_用神五行() : set_格式設定2() : set_貴人爻()
  877. End If
  878. End Sub
  879. Private Sub ComboBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox4.TextChanged
  880. If ComboBox4.Text = "" Then : MsgBox("請選擇用神、五行。") : Else : set_用原忌仇() : End If
  881. End Sub
  882. Private Sub ComboBox5_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox5.TextChanged
  883. If ComboBox5.Text = "" Then : MsgBox("請選擇用神、五行。") : Else : set_用原忌仇() : set_用神五行() : End If
  884. End Sub
  885. Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
  886. If DateTimePicker1.Text = "" Or ComboBox1.Text = "" Or ComboBox2.Text = "" Or ComboBox3.Text = "" Or ComboBox4.Text = "" Or ComboBox5.Text = "" Or TextBox179.Text = "" Then
  887. MsgBox("請確認資料已輸入完整。")
  888. Else
  889. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  890. SQL1 = "SELECT TOP (1) 流水號 FROM 卜卦紀錄 ORDER BY 流水號 DESC"
  891. cmd1.Connection = conn1 : cmd1.CommandText = SQL1 : dr1 = cmd1.ExecuteReader
  892. If dr1.Read() Then : TextBox181.Text = dr1("流水號").ToString : End If : conn1.Close() : dr1.Close()
  893. If TextBox181.Text = "" Then : TextBox181.Text = "0" : End If
  894. TextBox182.Text = CStr(Double.Parse(TextBox181.Text) + 1)
  895. If conn1.State = ConnectionState.Closed Then : conn1.ConnectionString = ConString : conn1.Open() : End If
  896. SQL = "INSERT INTO 卜卦紀錄 (流水號, 日期, 卦數一, 卦數二, 卦數三, 用神, 五行, 占事者, 占事, 貴人, 三合, 三刑) VALUES ('" & TextBox182.Text &
  897. "', '" & Format(DateTimePicker1.Value, "yyyy/MM/dd") & "','" & ComboBox1.Text & "','" & ComboBox2.Text & "','" & ComboBox3.Text & "','" & ComboBox4.Text &
  898. "','" & ComboBox5.Text & "','" & TextBox183.Text & "','" & TextBox179.Text & "','" & TextBox199.Text & "','" & TextBox201.Text & "','" & TextBox201.Text & "')"
  899. cmd1.CommandText = SQL : cmd1.ExecuteNonQuery()
  900. MsgBox("存檔完成")
  901. conn.Close()
  902. set_紀錄清單() : set_grid()
  903. End If
  904. End Sub
  905. Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
  906. If DateTimePicker1.Text = "" Or ComboBox1.Text = "" Or ComboBox2.Text = "" Or ComboBox3.Text = "" Or ComboBox4.Text = "" Or ComboBox5.Text = "" Or TextBox179.Text = "" Then
  907. MsgBox("請確已選擇歷史資料。")
  908. Else
  909. If conn.State = ConnectionState.Closed Then : conn.Open() : End If
  910. SQL = "UPDATE 卜卦紀錄 SET 日期 = '" & Format(DateTimePicker1.Value, "yyyy/MM/dd") & "', 卦數一 = '" & ComboBox1.Text & "', 卦數二 = '" & ComboBox2.Text &
  911. "', 卦數三 = '" & ComboBox3.Text & "', 用神 = '" & ComboBox4.Text & "' , 五行 = '" & ComboBox5.Text & "' , 占事者 = '" & TextBox183.Text & "' , 占事 = '" & TextBox179.Text & "' " &
  912. ", 貴人 = '" & TextBox199.Text & "' , 三合 = '" & TextBox200.Text & "' , 三刑 = '" & TextBox201.Text & "' WHERE (流水號 = '" & TextBox182.Text & "')"
  913. cmd.CommandText = SQL : cmd.ExecuteNonQuery()
  914. MsgBox("修改完成")
  915. conn.Close()
  916. set_紀錄清單() : set_grid()
  917. End If
  918. End Sub
  919. Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
  920. If DateTimePicker1.Text = "" Or ComboBox1.Text = "" Or ComboBox2.Text = "" Or ComboBox3.Text = "" Or ComboBox4.Text = "" Or ComboBox5.Text = "" Or TextBox179.Text = "" Then
  921. MsgBox("請確已選擇歷史資料。")
  922. Else
  923. SQL = "DELETE FROM 卜卦紀錄 WHERE (流水號 = '" & TextBox182.Text & "')"
  924. cmd.CommandText = SQL : cmd.Connection = conn
  925. If conn.State = ConnectionState.Closed Then : conn.Open() : End If
  926. Dim aa As MsgBoxResult
  927. aa = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
  928. If aa = MsgBoxResult.Ok Then : cmd.ExecuteNonQuery() : MsgBox("刪除完成") : End If
  929. conn.Close()
  930. set_紀錄清單() : set_grid()
  931. End If
  932. End Sub
  933. Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  934. If DateTimePicker1.Text = "" Or ComboBox1.Text = "" Or ComboBox2.Text = "" Or ComboBox3.Text = "" Or ComboBox4.Text = "" Or ComboBox5.Text = "" Or TextBox179.Text = "" Then
  935. MsgBox("請確已選擇歷史資料。")
  936. Else
  937. set_格式設定() : set_萬年曆() : set_萬年曆五行() : set_相氣休囚() : set_六獸() : set_日長生()
  938. If ComboBox1.Text = "" Or ComboBox2.Text = "" Or ComboBox3.Text = "" Then
  939. MsgBox("請輸入卜筮卦數 。")
  940. Else
  941. set_排掛() : set_化掛() : set_裝掛() : set_掛名() : set_掛地支五行() : set_世應伏身() : set_伏掛五行() : set_月建月破() : set_旬空() : set_日建日沖() : set_伏卦月建月破()
  942. set_伏卦旬空() : set_伏卦日建日沖() : set_化卦內容() : set_周易經文() : set_六沖六和()
  943. End If
  944. If ComboBox4.Text = "" Or ComboBox5.Text = "" Then : MsgBox("請選擇用神、五行。") : Else : set_用原忌仇() : set_用神五行() : End If
  945. set_格式設定2()
  946. End If
  947. End Sub
  948. Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
  949. set_格式設定()
  950. DateTimePicker1.Value = Today : ComboBox1.Text = "" : ComboBox2.Text = "" : ComboBox3.Text = ""
  951. TextBox24.Text = "" : TextBox99.Text = "" : TextBox100.Text = "" : TextBox101.Text = "" : TextBox139.Text = "" : TextBox140.Text = "" : TextBox141.Text = "" : TextBox142.Text = ""
  952. TextBox143.Text = "" : TextBox144.Text = "" : TextBox157.Text = "" : TextBox158.Text = "" : TextBox159.Text = "" : TextBox160.Text = "" : TextBox161.Text = "" : TextBox162.Text = ""
  953. TextBox163.Text = "" : TextBox164.Text = "" : TextBox165.Text = "" : TextBox166.Text = "" : TextBox167.Text = "" : TextBox168.Text = "" : TextBox169.Text = "" : TextBox170.Text = ""
  954. TextBox171.Text = "" : TextBox174.Text = "" : TextBox175.Text = "" : TextBox176.Text = "" : TextBox177.Text = "" : TextBox18.Text = "" : TextBox19.Text = ""
  955. TextBox20.Text = "" : TextBox21.Text = "" : TextBox22.Text = "" : TextBox23.Text = "" : TextBox12.Text = "" : TextBox13.Text = "" : TextBox14.Text = "" : TextBox15.Text = ""
  956. TextBox16.Text = "" : TextBox17.Text = "" : Label21.Text = " " : Label22.Text = " " : Label23.Text = " " : Label24.Text = " " : Label25.Text = " " : Label26.Text = " "
  957. Label27.Text = " " : Label28.Text = " " : Label29.Text = " " : Label30.Text = " " : Label31.Text = " " : Label32.Text = " " : Label15.Text = "一" : Label16.Text = "一"
  958. Label17.Text = "一" : Label18.Text = "一" : Label19.Text = "一" : Label20.Text = "一" : TextBox184.Text = "" : TextBox185.Text = "" : TextBox186.Text = "" : TextBox189.Text = ""
  959. TextBox191.Text = "" : TextBox192.Text = "" : TextBox199.Text = "" : TextBox200.Text = "" : TextBox201.Text = "" : TextBox199.Text = "" : TextBox240.Text = "" : TextBox179.Text = ""
  960. set_萬年曆() : set_萬年曆五行() : set_相氣休囚() : set_六獸() : set_日長生()
  961. End Sub
  962. Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  963. set_紀錄清單() : set_grid()
  964. End Sub
  965. Private Sub RadioButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.Click
  966. RadioButton1.Checked = True : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = False : RadioButton5.Checked = False
  967. End Sub
  968. Private Sub RadioButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.Click
  969. RadioButton1.Checked = False : RadioButton2.Checked = True : RadioButton3.Checked = False : RadioButton4.Checked = False : RadioButton5.Checked = False
  970. End Sub
  971. Private Sub RadioButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.Click
  972. RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = True : RadioButton4.Checked = False : RadioButton5.Checked = False
  973. End Sub
  974. Private Sub RadioButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.Click
  975. RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = True : RadioButton5.Checked = False
  976. End Sub
  977. Private Sub RadioButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.Click
  978. RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = False : RadioButton5.Checked = True
  979. End Sub
  980. Private Sub RadioButton10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton10.Click
  981. RadioButton10.Checked = True : RadioButton9.Checked = False : RadioButton8.Checked = False : RadioButton7.Checked = False : RadioButton6.Checked = False
  982. End Sub
  983. Private Sub RadioButton9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton9.Click
  984. RadioButton10.Checked = False : RadioButton9.Checked = True : RadioButton8.Checked = False : RadioButton7.Checked = False : RadioButton6.Checked = False
  985. End Sub
  986. Private Sub RadioButton8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton8.Click
  987. RadioButton10.Checked = False : RadioButton9.Checked = False : RadioButton8.Checked = True : RadioButton7.Checked = False : RadioButton6.Checked = False
  988. End Sub
  989. Private Sub RadioButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton7.Click
  990. RadioButton10.Checked = False : RadioButton9.Checked = False : RadioButton8.Checked = False : RadioButton7.Checked = True : RadioButton6.Checked = False
  991. End Sub
  992. Private Sub RadioButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton6.Click
  993. RadioButton10.Checked = False : RadioButton9.Checked = False : RadioButton8.Checked = False : RadioButton7.Checked = False : RadioButton6.Checked = True
  994. End Sub
  995. Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click
  996. If Label9.Text = "青龍" Then : 青龍() : Else : If Label9.Text = "朱雀" Then : 朱雀() : Else : If Label9.Text = "勾陳" Then : 勾陳() : Else : If Label9.Text = "騰蛇" Then : 騰蛇()
  997. Else : If Label9.Text = "白虎" Then : 白虎() : Else : If Label9.Text = "玄武" Then : 玄武() : End If : End If : End If : End If : End If : End If
  998. End Sub
  999. Private Sub Label10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label10.Click
  1000. If Label10.Text = "青龍" Then : 青龍() : Else : If Label10.Text = "朱雀" Then : 朱雀() : Else : If Label10.Text = "勾陳" Then : 勾陳() : Else : If Label10.Text = "騰蛇" Then : 騰蛇()
  1001. Else : If Label10.Text = "白虎" Then : 白虎() : Else : If Label10.Text = "玄武" Then : 玄武() : End If : End If : End If : End If : End If : End If
  1002. End Sub
  1003. Private Sub Label11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label11.Click
  1004. If Label11.Text = "青龍" Then : 青龍() : Else : If Label11.Text = "朱雀" Then : 朱雀() : Else : If Label11.Text = "勾陳" Then : 勾陳() : Else : If Label11.Text = "騰蛇" Then : 騰蛇()
  1005. Else : If Label11.Text = "白虎" Then : 白虎() : Else : If Label11.Text = "玄武" Then : 玄武() : End If : End If : End If : End If : End If : End If
  1006. End Sub
  1007. Private Sub Label12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label12.Click
  1008. If Label12.Text = "青龍" Then : 青龍() : Else : If Label12.Text = "朱雀" Then : 朱雀() : Else : If Label12.Text = "勾陳" Then : 勾陳() : Else : If Label12.Text = "騰蛇" Then : 騰蛇()
  1009. Else : If Label12.Text = "白虎" Then : 白虎() : Else : If Label12.Text = "玄武" Then : 玄武() : End If : End If : End If : End If : End If : End If
  1010. End Sub
  1011. Private Sub Label13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label13.Click
  1012. If Label13.Text = "青龍" Then : 青龍() : Else : If Label13.Text = "朱雀" Then : 朱雀() : Else : If Label13.Text = "勾陳" Then : 勾陳() : Else : If Label13.Text = "騰蛇" Then : 騰蛇()
  1013. Else : If Label13.Text = "白虎" Then : 白虎() : Else : If Label13.Text = "玄武" Then : 玄武() : End If : End If : End If : End If : End If : End If
  1014. End Sub
  1015. Private Sub Label14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label14.Click
  1016. If Label14.Text = "青龍" Then : 青龍() : Else : If Label14.Text = "朱雀" Then : 朱雀() : Else : If Label14.Text = "勾陳" Then : 勾陳() : Else : If Label14.Text = "騰蛇" Then : 騰蛇()
  1017. Else : If Label14.Text = "白虎" Then : 白虎() : Else : If Label14.Text = "玄武" Then : 玄武() : End If : End If : End If : End If : End If : End If
  1018. End Sub
  1019. Private Sub 青龍()
  1020. MsgBox("發動青龍附用通,進財進祿福無窮,臨仇遇忌都無益,酒色成災在此中。")
  1021. End Sub
  1022. Private Sub 朱雀()
  1023. MsgBox("朱雀交重文印旺,煞神相併漫勞功,是非口舌皆因此,動出生身卻利公。")
  1024. End Sub
  1025. Private Sub 勾陳()
  1026. MsgBox("勾陳發動優田土,累歲迍邅為忌逢,生用有情方是吉,若然安靜不迷蒙。")
  1027. End Sub
  1028. Private Sub 騰蛇()
  1029. MsgBox("騰蛇鬼剋憂縈粹,怪夢陰魔暗裡攻,持木落空休道吉,逢沖之日莫逃凶。")
  1030. End Sub
  1031. Private Sub 白虎()
  1032. MsgBox("白虎交重喪惡事,官司病患必成凶,持金動剋妨人口,遇火生身便不同。")
  1033. End Sub
  1034. Private Sub 玄武()
  1035. MsgBox("玄武動搖多暗昧,若臨官鬼賊交攻,有情生世邪無犯,仇忌臨之姦盜凶。")
  1036. End Sub
  1037. Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
  1038. MsgBox("凡卦中旺相之爻,倘被日辰及動爻克制,目下貪榮得令,過時仍受其毒,此旺相者暫時之用也。凡卦中休囚之爻,如得日辰及動爻生扶,目下雖不能逞志,遇時仍然得意,此休囚者待時之用也。")
  1039. End Sub
  1040. Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
  1041. MsgBox("《黃金策》事阻隔兮間發,謂此兩爻,居世應之中,動阻兩家之事,使彼此不能相通也,世應中間兩間爻發動,則所求多阻隔。《增刪卜易》世為己,應為人,彼此欲相親者,若遇間 _爻發動,不" &
  1042. "可概以阻隔斷之,若得動而生合世應,反得此輩之力。近世爻者,幫我之人也。近應爻者,扶彼之人也。生我者,我當親之;剋我者,我宜遠之。獨忌剋乎世應,事必難成。剋我者,壞我之事,我" &
  1043. "被其愚;剋應者,壞彼之事,他為所誘。")
  1044. End Sub
  1045. Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
  1046. MsgBox("凡卦中月破之爻,乃關因之所現也。動者亦能生剋他爻,變者亦能生剋本爻。目下雖破,出月不破! 今日雖破,值日不破矣! 月破最喜逢合填實,遠應年月,近應日時。如破而安靜,再值旬空衰" &
  1047. "弱,遇動爻、月建、日辰剋害,此等月破,謂之真破,到比破矣!")
  1048. End Sub
  1049. Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
  1050. MsgBox("凡卦中遇旬空,乃神蹟發現於此也。如旺相旬空、或休囚發動、日辰生扶、爻動生扶、爻動變空、伏而旺相,此等旬空到底有用,不過待其出旬之日。有合空、沖起、充實、填補之法,後捲占驗" &
  1051. "注明。如休囚安靜、或日辰剋、動爻剋、伏而被剋、靜逢月破,值此等旬空者,謂之真空,到底空矣!")
  1052. End Sub
  1053. Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
  1054. MsgBox("原用二神局則吉,忌仇二構局則凶。成局者結黨也,卦中動爻雖敢制之,如三爻齊發合成用神局,必有一爻用神;合成原神局,必有一爻原神;合成仇忌局,必有一爻仇忌,宗其一爻有病關因者" &
  1055. "斷之。或遇日沖者,曰暗動(此言靜而日沖),曰實(此言動而逢空,日辰沖也),曰破(此言月建沖也),但其沖破也,必待相合之期至,而應事之吉凶。如一爻靜二爻發者,待一爻靜者值日應事。" &
  1056. "如一爻靜而逢空、或動而逢空者、或化而逢空者,待其出空之期應事之吉凶。如空而逢合、靜而逢合、動而逢合者,必待沖期至而應事之吉凶;如自化合或與日合,如自化墓或墓于日者,必待其" &
  1057. "沖(此言三爻齊發,二爻無病,至自化者言也),如自化絕或絕于日者,必待其生(亦指一爻有病者而言也)。")
  1058. End Sub
  1059. Private Sub Label48_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label48.Click
  1060. MsgBox("如卦中仇神發動,則原神被傷,用神無根,忌神倍力,其禍可勝道耶。")
  1061. End Sub
  1062. Private Sub Label49_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label49.Click
  1063. MsgBox("看卦先須看忌神,忌神宜靜不宜興,忌神急要逢傷剋,若遇生扶用受刑。---如忌神動來剋用,而用爻出現不空,則受剋也。倘卦中又動出一爻原神生用,則忌神反生原神,是名貪生忘剋,則用" &
  1064. "神根蒂深固,其吉更倍矣。如忌神獨發而用爻旬空,謂之避空,如伏藏不現,謂之避凶。如月建日辰生用謂之得救,如是等仍為吉兆,夫亦何嫌何疑哉。如忌神變回頭之剋,或日辰月建沖剋之," &
  1065. "謂之賊欲害我是賊先受害也,我又何傷。如日辰月建生扶忌神,或忌神疊疊剋用,即使用神蔽空伏藏者,至出空出透時便受其毒,難免其災也。")
  1066. End Sub
  1067. Private Sub Label47_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label47.Click
  1068. MsgBox("原神發動志揚揚,用扶藏兮也不妨,需要生扶兼旺相,最嫌化剋及逢傷。---如用神旬空、月破、衰弱或伏藏不現,得原神動來生之,或日辰月建作原神生之,必待用神出旬出破得令值日,所求必" &
  1069. "遂矣。如用神旺相,原神休囚不動,或動而變墓、變絕、變剋、變破、變退,或被日辰月建剋制,皆不能生用,是用神根蒂被傷矣,不唯無益,而反有損也。")
  1070. End Sub
  1071. Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click
  1072. MsgBox("問卦先須看日辰,日辰剋用不甚親,日辰與用相生合,作事何愁不趁心。")
  1073. End Sub
  1074. Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
  1075. MsgBox("易爻不妄成,神爻豈亂發。體象或既成,無者型憂色。使須論用神,次必看原神。三合會用吉,祿馬最為良。爻動始為定,次者論空亡。六沖主沖併,刑剋具主傷。世應俱發動,必然有改張。" &
  1076. "龍動家有喜,虎動主有喪。勾陳朱雀動,田土與文章。財動憂尊長,父動損兒郎。子動男人滯,兄動女人殃。出行宜世動,歸魂不出疆。用動值三合,行人立回莊。占宅財龍旺,豪富冠一鄉。" &
  1077. "父母爻興旺,為官至侯王。福神若持世,官頌定無妨。勾陳剋玄武,補賊不須忙。父病嫌財殺,財興母不長。無鬼病難療,鬼旺主發狂。請看考鬼歷,禱謝得安康。占婚兼剋用,占產看陰陽。" &
  1078. "若要問風水,三四世吉昌。長生墓絕決,卦卦要審祥。萬千言不盡,略舉其大綱。分別各有類,無務不包藏。")
  1079. End Sub
  1080. Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
  1081. If CheckBox1.Checked = True Then : MsgBox("世爻旺相最為強,做事亨通大吉昌,謀望諸般皆遂意,用神生合妙難量,旬空月破逢非吉,剋害刑沖遇不良。") : End If
  1082. If RadioButton1.Checked = False And RadioButton2.Checked = False And RadioButton3.Checked = False And RadioButton4.Checked = False And RadioButton5.Checked = False Then
  1083. MsgBox("請選擇持世之六親") : Else
  1084. If RadioButton1.Checked = True And RadioButton2.Checked = False And RadioButton3.Checked = False And RadioButton4.Checked = False And RadioButton5.Checked = False Then
  1085. MsgBox("父母持世主身勞,求嗣妾眾也難招,官動財旺宜赴試,財搖謀利莫心焦,占身財動無賢婦,又恐區區壽不高。") : Else
  1086. If RadioButton1.Checked = False And RadioButton2.Checked = True And RadioButton3.Checked = False And RadioButton4.Checked = False And RadioButton5.Checked = False Then
  1087. MsgBox("子身持世事無憂,求名切忌坐當頭,避亂許安失可得,官頌從今了便休,有生無剋諸般吉,有剋無生反見愁。") : Else
  1088. If RadioButton1.Checked = False And RadioButton2.Checked = False And RadioButton3.Checked = True And RadioButton4.Checked = False And RadioButton5.Checked = False Then
  1089. MsgBox("鬼爻持世事難安,占身不病也遭官,財物時時憂失脫,功名最喜世當權,入墓愁疑無散日,逢沖轉禍變成歡。") : Else
  1090. If RadioButton1.Checked = False And RadioButton2.Checked = False And RadioButton3.Checked = False And RadioButton4.Checked = True And RadioButton5.Checked = False Then
  1091. MsgBox("財搖持世益財榮,兄弟交重不可逢,更遇子孫明暗動,利身剋父喪文風,求官問訟宜財托,變動兄官萬事兄。") : Else
  1092. If RadioButton1.Checked = False And RadioButton2.Checked = False And RadioButton3.Checked = False And RadioButton4.Checked = False And RadioButton5.Checked = True Then
  1093. MsgBox("兄弟持世莫求財,官興需慮禍將來,朱雀並臨防口舌,如搖必定損妻財,父母相生身有壽,化官化鬼有奇災。")
  1094. End If : End If : End If : End If : End If : End If
  1095. End Sub
  1096. Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click
  1097. MsgBox("身臨福德不見官,所憂畢竟變成歡,目前兇事終須吉,緊急還來漸漸寬。身臨原用與青龍,定期喜事入門中,若逢驛馬身爻動,出路謀求事事通。身爻切忌入空亡,做事難成且守常,刑傷破絕皆為忌" &
  1098. "勸君安分守家邦。")
  1099. End Sub
  1100. Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click
  1101. MsgBox("正卦如無變又無,就將首卦六親攻,動爻生用終須吉,若遇交重剋用兇。")
  1102. End Sub
  1103. Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
  1104. MsgBox("發動逢沖不謂空,靜空遇剋卻為空,忌神最喜逢空吉,用與原神不可空。春土夏金秋樹木,三冬逢火是真空,旬空又值真空象,再遇爻傷到底空。" &
  1105. "勸君安分守家邦。")
  1106. End Sub
  1107. Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
  1108. MsgBox("用爻發動再宮中,縱值休囚亦不兇,更得生扶兼旺相,管教作事永亨通。")
  1109. End Sub
  1110. Private Sub Button24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button24.Click
  1111. If RadioButton10.Checked = False And RadioButton9.Checked = False And RadioButton8.Checked = False And RadioButton7.Checked = False And RadioButton6.Checked = False Then
  1112. MsgBox("請選擇發動之六親") : Else
  1113. If RadioButton10.Checked = True And RadioButton9.Checked = False And RadioButton8.Checked = False And RadioButton7.Checked = False And RadioButton6.Checked = False Then
  1114. MsgBox("父動當頭剋子孫,病人無藥主昏沉,姻親子息應難得,買賣勞心利不存,觀望行人書信動,論官下狀理先分,士人科舉登金榜,失誤逃亡要訴論。") : Else
  1115. End If
  1116. If RadioButton10.Checked = False And RadioButton9.Checked = True And RadioButton8.Checked = False And RadioButton7.Checked = False And RadioButton6.Checked = False Then
  1117. MsgBox("子孫發動傷官鬼,占病求醫身便癒,行人買賣身康泰,婚姻喜美事前緣,產婦當生子易養,詞訟私和不到官,謁貴求名休進用,勸君守分聽乎天。") : Else
  1118. End If
  1119. If RadioButton10.Checked = False And RadioButton9.Checked = False And RadioButton8.Checked = True And RadioButton7.Checked = False And RadioButton6.Checked = False Then
  1120. MsgBox("官鬼從來剋兄弟,婚姻未就生疑滯,病困門庭禍崇來,耕種蠶桑皆不利,外出逃亡定見災,詞訟官非有囚繫,買賣財輕賭博輸,失脫難尋多暗昧。") : Else
  1121. End If
  1122. If RadioButton10.Checked = False And RadioButton9.Checked = False And RadioButton8.Checked = False And RadioButton7.Checked = True And RadioButton6.Checked = False Then
  1123. MsgBox("財爻發動剋文書,應舉求名總是虛,將本經營為大吉,親姻如意藥無虞,行人在外身將動,產婦求財身脫除,失物安靜家未出,病人傷胃更傷脾。") : Else
  1124. End If
  1125. If RadioButton10.Checked = False And RadioButton9.Checked = False And RadioButton8.Checked = False And RadioButton7.Checked = False And RadioButton6.Checked = True Then
  1126. MsgBox("兄弟交重剋了財,病人離癒未難災,應舉奪標為忌客,官非陰賊耗錢財,若帶吉神為有助,出入行人便未來,貨物經商消折本,買婢求妻事不諧。") : Else
  1127. End If
  1128. End If
  1129. End Sub
  1130. Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button23.Click
  1131. If RadioButton10.Checked = False And RadioButton9.Checked = False And RadioButton8.Checked = False And RadioButton7.Checked = False And RadioButton6.Checked = False Then
  1132. MsgBox("請選擇發動之六親") : Else
  1133. If RadioButton10.Checked = True And RadioButton9.Checked = False And RadioButton8.Checked = False And RadioButton7.Checked = False And RadioButton6.Checked = False Then
  1134. MsgBox("父母化父母,近神文書許,化子不傷丁,化鬼官遷舉,化財宅長憂,兄弟為泄氣。") : Else
  1135. End If
  1136. If RadioButton10.Checked = False And RadioButton9.Checked = True And RadioButton8.Checked = False And RadioButton7.Checked = False And RadioButton6.Checked = False Then
  1137. MsgBox("子孫化退神,人財不稱情,化父田蠶敗,化財加倍榮,化鬼憂生產,兄弟謂相生。") : Else
  1138. End If
  1139. If RadioButton10.Checked = False And RadioButton9.Checked = False And RadioButton8.Checked = True And RadioButton7.Checked = False And RadioButton6.Checked = False Then
  1140. MsgBox("官化進神祿,求官應疾連,化財占病兇,化父父書遂,化子必傷官,化兄家不睡。") : Else
  1141. End If
  1142. If RadioButton10.Checked = False And RadioButton9.Checked = False And RadioButton8.Checked = False And RadioButton7.Checked = True And RadioButton6.Checked = False Then
  1143. MsgBox("妻財化進神,錢財入宅來,化官憂戚戚,化子笑哈哈,化父宜家長,化兄當破財。") : Else
  1144. End If
  1145. If RadioButton10.Checked = False And RadioButton9.Checked = False And RadioButton8.Checked = False And RadioButton7.Checked = False And RadioButton6.Checked = True Then
  1146. MsgBox("兄弟化退神,凡占無所忌,化父妾奴驚,化財財未遂,化官弟有災,化子卻如意。") : Else
  1147. End If : End If
  1148. End Sub
  1149. Private Sub Button25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button25.Click
  1150. MsgBox("土爻動而變木,木爻動而變金,金爻動而變火,火爻動而變水,水爻動而變土,此是爻之回頭剋也。乾兌卦之離,離之坎,坎之艮坤,艮坤之震巽,震巽之乾兌,此是卦之回頭剋也。凡遇回頭剋" &
  1151. "者,徹底剋盡。原用二神遇之則兇,忌仇二神遇之反吉。")
  1152. End Sub
  1153. Private Sub Label80_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label80.Click
  1154. MsgBox("寅日占卦,金爻絕于寅,如卦中有土爻動而生之,是絕處逢生也。")
  1155. End Sub
  1156. Private Sub Label81_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label81.Click
  1157. MsgBox("申日占卦,木爻絕于申,如卦中有水爻動而生之,是絕處逢生也。")
  1158. End Sub
  1159. Private Sub Label84_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label84.Click
  1160. MsgBox("巳日占卦,水爻絕于巳,如卦中有金爻動而生之,是絕處逢生也。")
  1161. End Sub
  1162. Private Sub Label82_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label82.Click
  1163. MsgBox("亥日占卦,火爻絕于亥,如卦中有木爻動而生之,是絕處逢生也。")
  1164. End Sub
  1165. Private Sub Button31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button31.Click
  1166. MsgBox("青龍最喜悅而多仁,附忌神凡謀不利。白虎最兇勇而好殺,生用神諸為則吉。朱雀剋身,口舌是非常有,如來生用,文書音信當回。勾陳屬土,空則田園欠熟,剛強剋世,公差牽扯拘遲。騰蛇怪異" &
  1167. "虛驚,玄武私情盜賊。白虎血神生產,偏宜發動。午宮化朱雀水,何忌火災。騰蛇木鬼欺身,恐自縊難逃枷鎖。玄武官生靜世,交小人莫慮干連。世剋靜,青龍巡捕戲場酒肆上。鬼動勾陳,論祈禱" &
  1168. "訴酬太歲,問病原腫脹黃浮。")
  1169. End Sub
  1170. Private Sub Button26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button26.Click
  1171. MsgBox("凡卦中子爻變丑,戌變卯,此子與丑合,卯與戌合,合中帶剋,合三剋七之分,如旺相得日月生扶幫比,或卦中動爻生之,世作合論也。被日月剋之,或卦中動剋之,世作剋論也。為申金化巳火者" &
  1172. "即無日月與動爻相生,不作剋論,乃化合化長生也,倘寅月日占之,是三刑會聚,申被寅沖,則不可以吉論矣。")
  1173. End Sub
  1174. Private Sub Button27_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button27.Click
  1175. MsgBox("合處逢沖有三 : 凡六合變六沖一也。日月沖爻二也。動爻變沖三也。---沖中處逢合亦有三 : 凡六沖變六合一也。日月合爻二也。動爻變合三也---合處逢沖,謀雖成而終散。沖中逢合,事已散而復成")
  1176. End Sub
  1177. Private Sub Button28_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button28.Click
  1178. MsgBox("為巳日占卦,土爻絕于巳,如月建生扶幫比,土爻不謂絕也,謂之日生。如土化出巳,有日月幫比,不云化絕,乃云回頭生也。如日月制土,則是絕于日也,則是化絕于爻也。如酉日占卦,寅爻被剋" &
  1179. ",卦終有水爻動而生之,是剋處逢生矣,餘例如之。大凡絕處逢生,寒谷逢春,剋處逢生,兇後見吉也。")
  1180. End Sub
  1181. Private Sub Button29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button29.Click
  1182. MsgBox("凡卦終亥變子,丑變辰,寅變卯,辰變未,巳變午,未變戌,申變酉,戌變丑,乃進神也。進神者吉凶倍增其勢也。")
  1183. End Sub
  1184. Private Sub Button30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button30.Click
  1185. MsgBox("凡卦終子變亥,戌變未,酉變申,未變辰,午變巳,辰變丑,卯變寅,丑變戌,乃退神也。退神者吉凶漸減其威也。")
  1186. End Sub
  1187. Private Sub Button32_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button32.Click
  1188. MsgBox("如甲戊日卜卦,見丑未爻即是日貴人,又如甲戊生人見之,為命貴人。----甲戊兼牛羊,乙己鼠猴鄉,丙丁豬雞位,壬癸兔蛇藏,庚辛逢馬虎,此是貴人方。")
  1189. End Sub
  1190. Private Sub Button33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button33.Click
  1191. MsgBox("子水鼠,丑土牛,寅木虎,卯木兔,辰土龍,巳火蛇,午火馬,未土羊,申金猴,酉金雞,戌土狗,亥水豬")
  1192. End Sub
  1193. End Class