Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

下拉清單_1.vb 9.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. Public Class 下拉清單_1
  2. Dim 頁數, 總頁數, F1, F2, F3, F4, F5, F6, F7, F8 As Integer
  3. Dim 有選擇 As Boolean
  4. Dim EER As String
  5. Private Sub PnlTitleBar_Paint(sender As Object, e As PaintEventArgs) Handles PnlTitleBar.Paint
  6. End Sub
  7. Private Sub 下拉清單_1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  8. '--目前設定PPBB最長3000格------
  9. End Sub
  10. Private Sub 下拉清單_1_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
  11. If 有選擇 = False Then : PPAA = "" : End If
  12. End Sub
  13. Private Sub 下拉清單_1_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  14. 風格()
  15. If 系統語言 = "繁體中文" Then : 主題_lb.Text = "選擇清單" : EER = "選取的位置沒有資料!!"
  16. ElseIf 系統語言 = "English" Then : 主題_lb.Text = "Pick List" : EER = "No data available at selected location!!"
  17. ElseIf 系統語言 = "Indonesian" Then : 主題_lb.Text = "Daftar Pilih" : EER = "Tidak ada data yang tersedia di lokasi yang dipilih!!" : End If
  18. 有選擇 = False
  19. 總頁數 = NN1 / 99 + 1 : 頁數 = 1 : F1 = 0 : F2 = 24 : F3 = 25 : F4 = 49 : F5 = 50 : F6 = 74 : F7 = 75 : F8 = 99
  20. If NN1 < 99 Then : 上一頁_bt.Enabled = False : 下一頁_bt.Enabled = False : Else : 上一頁_bt.Enabled = False : 下一頁_bt.Enabled = True : End If
  21. ListBox1.Items.Clear() : ListBox2.Items.Clear() : ListBox3.Items.Clear() : ListBox4.Items.Clear()
  22. If NN1 <= 24 Then
  23. For I As Integer = F1 To NN1 : ListBox1.Items.Add(PPBB(I)) : Next
  24. ElseIf NN1 > 24 And NN1 <= 49 Then
  25. 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
  26. ElseIf NN1 > 49 And NN1 <= 74 Then
  27. 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
  28. For I As Integer = F5 To NN1 : ListBox3.Items.Add(PPBB(I)) : Next
  29. ElseIf NN1 > 74 Then
  30. 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
  31. 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
  32. End If
  33. End Sub
  34. Private Sub 上一頁_bt_Click(sender As Object, e As EventArgs) Handles 上一頁_bt.Click
  35. 頁數 -= 1 : ListBox1.Items.Clear() : ListBox2.Items.Clear() : ListBox3.Items.Clear() : ListBox4.Items.Clear()
  36. F1 -= 100 : F2 -= 100 : F3 -= 100 : F4 -= 100 : F5 -= 100 : F6 -= 100 : F7 -= 100 : F8 -= 100
  37. If 頁數 = 1 Then
  38. 上一頁_bt.Enabled = False : 下一頁_bt.Enabled = True
  39. ElseIf 頁數 > 1 Then
  40. 上一頁_bt.Enabled = True : 下一頁_bt.Enabled = True
  41. End If
  42. 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
  43. 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
  44. End Sub
  45. Private Sub 下一頁_bt_Click(sender As Object, e As EventArgs) Handles 下一頁_bt.Click
  46. 頁數 += 1 : ListBox1.Items.Clear() : ListBox2.Items.Clear() : ListBox3.Items.Clear() : ListBox4.Items.Clear()
  47. F1 += 100 : F2 += 100 : F3 += 100 : F4 += 100 : F5 += 100 : F6 += 100 : F7 += 100 : F8 += 100
  48. If 頁數 < 總頁數 Then
  49. 上一頁_bt.Enabled = True : 下一頁_bt.Enabled = True
  50. 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
  51. 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
  52. ElseIf 頁數 = 總頁數 Then
  53. 上一頁_bt.Enabled = True : 下一頁_bt.Enabled = False
  54. If NN1 <= F2 Then
  55. For I As Integer = F1 To NN1 : ListBox1.Items.Add(PPBB(I)) : Next
  56. ElseIf NN1 <= F4 Then
  57. 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
  58. ElseIf NN1 <= F6 Then
  59. 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
  60. For I As Integer = F5 To NN1 : ListBox3.Items.Add(PPBB(I)) : Next
  61. ElseIf NN1 <= F8 Then
  62. 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
  63. 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
  64. End If
  65. End If
  66. End Sub
  67. Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
  68. If IsNothing(ListBox1.SelectedItem) = True Then : 通知訊息 = EER : 訊息類型 = "1" : 通知視窗.ShowDialog() : 有選擇 = False
  69. Else : PPAA = ListBox1.SelectedItem.ToString() : 有選擇 = True : Me.Close() : End If
  70. End Sub
  71. Private Sub ListBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox2.SelectedIndexChanged
  72. If IsNothing(ListBox2.SelectedItem) = True Then : 通知訊息 = EER : 訊息類型 = "1" : 通知視窗.ShowDialog() : 有選擇 = False
  73. Else : PPAA = ListBox2.SelectedItem.ToString() : 有選擇 = True : Me.Close() : End If
  74. End Sub
  75. Private Sub ListBox3_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox3.SelectedIndexChanged
  76. If IsNothing(ListBox3.SelectedItem) = True Then : 通知訊息 = EER : 訊息類型 = "1" : 通知視窗.ShowDialog() : 有選擇 = False
  77. Else : PPAA = ListBox3.SelectedItem.ToString() : 有選擇 = True : Me.Close() : End If
  78. End Sub
  79. Private Sub ListBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox4.SelectedIndexChanged
  80. If IsNothing(ListBox4.SelectedItem) = True Then : 通知訊息 = EER : 訊息類型 = "1" : 通知視窗.ShowDialog() : 有選擇 = False
  81. Else : PPAA = ListBox4.SelectedItem.ToString() : 有選擇 = True : Me.Close() : End If
  82. End Sub
  83. Private Sub Cancel_bt_Click(sender As Object, e As EventArgs) Handles Cancel_bt.Click
  84. Me.Close()
  85. End Sub
  86. Private Sub 風格()
  87. If 深色風格 = False Then
  88. Me.BackColor = Color.Linen : Panel1.BackgroundImage = My.Resources._62951168976601486 : 主題_lb.ForeColor = Color.Black
  89. ListBox1.BackColor = Color.White : ListBox1.ForeColor = Color.Black : ListBox2.BackColor = Color.White : ListBox2.ForeColor = Color.Black
  90. ListBox3.BackColor = Color.White : ListBox3.ForeColor = Color.Black : ListBox4.BackColor = Color.White : ListBox4.ForeColor = Color.Black
  91. Else
  92. Me.BackColor = Color.Black : Panel1.BackgroundImage = My.Resources._20157059_MotionElements_diagonal_lines : 主題_lb.ForeColor = Color.White
  93. ListBox1.BackColor = Color.DimGray : ListBox1.ForeColor = Color.White : ListBox2.BackColor = Color.DimGray : ListBox2.ForeColor = Color.White
  94. ListBox3.BackColor = Color.DimGray : ListBox3.ForeColor = Color.White : ListBox4.BackColor = Color.DimGray : ListBox4.ForeColor = Color.White
  95. End If
  96. End Sub
  97. Dim nOldWndLeft, nOldWndTop, nClickX, nClickY As Integer
  98. Private Sub PnlTitleBar_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PnlTitleBar.MouseDown
  99. '紀錄滑鼠點選時的視窗位置與滑鼠點選位置
  100. nOldWndLeft = Me.Left : nOldWndTop = Me.Top : nClickX = e.X : nClickY = e.Y
  101. End Sub
  102. Private Sub PnlTitleBar_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PnlTitleBar.MouseMove
  103. If PnlTitleBar.Capture = True Then '如果滑鼠按著拖曳
  104. Me.Top = e.Y + nOldWndTop - nClickY : Me.Left = e.X + nOldWndLeft - nClickX '設定新的視窗位置
  105. nOldWndLeft = Me.Left : nOldWndTop = Me.Top '更新紀錄的視窗位置
  106. End If
  107. End Sub
  108. Private Sub 主題_lb_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 主題_lb.MouseDown
  109. '紀錄滑鼠點選時的視窗位置與滑鼠點選位置
  110. nOldWndLeft = Me.Left : nOldWndTop = Me.Top : nClickX = e.X : nClickY = e.Y
  111. End Sub
  112. Private Sub 主題_lb_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 主題_lb.MouseMove
  113. If 主題_lb.Capture = True Then '如果滑鼠按著拖曳
  114. Me.Top = e.Y + nOldWndTop - nClickY : Me.Left = e.X + nOldWndLeft - nClickX '設定新的視窗位置
  115. nOldWndLeft = Me.Left : nOldWndTop = Me.Top '更新紀錄的視窗位置
  116. End If
  117. End Sub
  118. End Class