Ei kuvausta
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.

下拉清單_1.vb 6.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. Public Class 下拉清單_1
  2. Dim 頁數, 總頁數, F1, F2, F3, F4, F5, F6, F7, F8 As Integer
  3. Dim 有選擇 As Boolean
  4. Private Sub 下拉清單_1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  5. '--目前設定PPBB最長3000格------
  6. End Sub
  7. Private Sub 下拉清單_1_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
  8. If 有選擇 = False Then : PPAA = "" : End If
  9. End Sub
  10. Private Sub 下拉清單_1_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  11. 有選擇 = False
  12. 總頁數 = NN1 / 99 + 1 : 頁數 = 1 : F1 = 0 : F2 = 24 : F3 = 25 : F4 = 49 : F5 = 50 : F6 = 74 : F7 = 75 : F8 = 99
  13. If NN1 < 99 Then : 上一頁_bt.Enabled = False : 下一頁_bt.Enabled = False : Else : 上一頁_bt.Enabled = False : 下一頁_bt.Enabled = True : End If
  14. ListBox1.Items.Clear() : ListBox2.Items.Clear() : ListBox3.Items.Clear() : ListBox4.Items.Clear()
  15. If NN1 <= 24 Then
  16. For I As Integer = F1 To NN1 : ListBox1.Items.Add(PPBB(I)) : Next
  17. ElseIf NN1 > 24 And NN1 <= 49 Then
  18. For I As Integer = F1 To F2 : ListBox1.Items.Add(PPBB(I)) : Next : For I As Integer = F3 To NN1 : ListBox2.Items.Add(PPBB(I)) : Next
  19. ElseIf NN1 > 49 And NN1 <= 74 Then
  20. For I As Integer = F1 To F2 : ListBox1.Items.Add(PPBB(I)) : Next : For I As Integer = F3 To F4 : ListBox2.Items.Add(PPBB(I)) : Next
  21. For I As Integer = F5 To NN1 : ListBox3.Items.Add(PPBB(I)) : Next
  22. ElseIf NN1 > 74 Then
  23. For I As Integer = F1 To F2 : ListBox1.Items.Add(PPBB(I)) : Next : For I As Integer = F3 To F4 : ListBox2.Items.Add(PPBB(I)) : Next
  24. For I As Integer = F5 To F6 : ListBox3.Items.Add(PPBB(I)) : Next : For I As Integer = F7 To F8 : ListBox4.Items.Add(PPBB(I)) : Next
  25. End If
  26. End Sub
  27. Private Sub 上一頁_bt_Click(sender As Object, e As EventArgs) Handles 上一頁_bt.Click
  28. 頁數 -= 1 : ListBox1.Items.Clear() : ListBox2.Items.Clear() : ListBox3.Items.Clear() : ListBox4.Items.Clear()
  29. F1 -= 100 : F2 -= 100 : F3 -= 100 : F4 -= 100 : F5 -= 100 : F6 -= 100 : F7 -= 100 : F8 -= 100
  30. If 頁數 = 1 Then
  31. 上一頁_bt.Enabled = False : 下一頁_bt.Enabled = True
  32. ElseIf 頁數 > 1 Then
  33. 上一頁_bt.Enabled = True : 下一頁_bt.Enabled = True
  34. End If
  35. For I As Integer = F1 To F2 : ListBox1.Items.Add(PPBB(I)) : Next : For I As Integer = F3 To F4 : ListBox2.Items.Add(PPBB(I)) : Next
  36. For I As Integer = F5 To F6 : ListBox3.Items.Add(PPBB(I)) : Next : For I As Integer = F7 To F8 : ListBox4.Items.Add(PPBB(I)) : Next
  37. End Sub
  38. Private Sub 下一頁_bt_Click(sender As Object, e As EventArgs) Handles 下一頁_bt.Click
  39. 頁數 += 1 : ListBox1.Items.Clear() : ListBox2.Items.Clear() : ListBox3.Items.Clear() : ListBox4.Items.Clear()
  40. F1 += 100 : F2 += 100 : F3 += 100 : F4 += 100 : F5 += 100 : F6 += 100 : F7 += 100 : F8 += 100
  41. If 頁數 < 總頁數 Then
  42. 上一頁_bt.Enabled = True : 下一頁_bt.Enabled = True
  43. For I As Integer = F1 To F2 : ListBox1.Items.Add(PPBB(I)) : Next : For I As Integer = F3 To F4 : ListBox2.Items.Add(PPBB(I)) : Next
  44. For I As Integer = F5 To F6 : ListBox3.Items.Add(PPBB(I)) : Next : For I As Integer = F7 To F8 : ListBox4.Items.Add(PPBB(I)) : Next
  45. ElseIf 頁數 = 總頁數 Then
  46. 上一頁_bt.Enabled = True : 下一頁_bt.Enabled = False
  47. If NN1 <= F2 Then
  48. For I As Integer = F1 To NN1 : ListBox1.Items.Add(PPBB(I)) : Next
  49. ElseIf NN1 <= F4 Then
  50. For I As Integer = F1 To F2 : ListBox1.Items.Add(PPBB(I)) : Next : For I As Integer = F3 To NN1 : ListBox2.Items.Add(PPBB(I)) : Next
  51. ElseIf NN1 <= F6 Then
  52. For I As Integer = F1 To F2 : ListBox1.Items.Add(PPBB(I)) : Next : For I As Integer = F3 To F4 : ListBox2.Items.Add(PPBB(I)) : Next
  53. For I As Integer = F5 To NN1 : ListBox3.Items.Add(PPBB(I)) : Next
  54. ElseIf NN1 <= F8 Then
  55. For I As Integer = F1 To F2 : ListBox1.Items.Add(PPBB(I)) : Next : For I As Integer = F3 To F4 : ListBox2.Items.Add(PPBB(I)) : Next
  56. For I As Integer = F5 To F6 : ListBox3.Items.Add(PPBB(I)) : Next : For I As Integer = F7 To NN1 : ListBox4.Items.Add(PPBB(I)) : Next
  57. End If
  58. End If
  59. End Sub
  60. Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
  61. If IsNothing(ListBox1.SelectedItem) = True Then
  62. If 系統語言 = "繁體中文" Then : MsgBox("選擇的地方沒有資料!!") : Else : MsgBox("There is no information in the selected place!!") : End If : 有選擇 = False : Else
  63. PPAA = ListBox1.SelectedItem.ToString() : 有選擇 = True : Me.Close()
  64. End If
  65. End Sub
  66. Private Sub ListBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox2.SelectedIndexChanged
  67. If IsNothing(ListBox2.SelectedItem) = True Then
  68. If 系統語言 = "繁體中文" Then : MsgBox("選擇的地方沒有資料!!") : Else : MsgBox("There is no information in the selected place!!") : End If : 有選擇 = False : Else
  69. PPAA = ListBox2.SelectedItem.ToString() : 有選擇 = True : Me.Close()
  70. End If
  71. End Sub
  72. Private Sub ListBox3_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox3.SelectedIndexChanged
  73. If IsNothing(ListBox3.SelectedItem) = True Then
  74. If 系統語言 = "繁體中文" Then : MsgBox("選擇的地方沒有資料!!") : Else : MsgBox("There is no information in the selected place!!") : End If : 有選擇 = False : Else
  75. PPAA = ListBox3.SelectedItem.ToString() : 有選擇 = True : Me.Close()
  76. End If
  77. End Sub
  78. Private Sub ListBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox4.SelectedIndexChanged
  79. If IsNothing(ListBox4.SelectedItem) = True Then
  80. If 系統語言 = "繁體中文" Then : MsgBox("選擇的地方沒有資料!!") : Else : MsgBox("There is no information in the selected place!!") : End If : 有選擇 = False : Else
  81. PPAA = ListBox4.SelectedItem.ToString() : 有選擇 = True : Me.Close()
  82. End If
  83. End Sub
  84. End Class