6 End Enum Private Sub Command1_Click() Dim My_Color As Color " 定義變數My_Color為Color的列舉型別 Dim Back_Color As Color " 定義變數Back_Color為Color的列舉型別 My_Color = Green " 對My_Color賦值 Back_Color = Black " 對Back_Color賦值 Text1.Text = My_Color + Back_Color " 文字框內顯示My_Color + Back_Color的值 End Sub具體的可以參考http://www.d269.com/vbjiaoxue/good_example/chapter2/5.HTM裡面有圖 程式會看的更明白些
Private Enum Color " 定義名為Color的列舉型別 Black =
1 White =
2 Yellow =
3 Red =
4 Green =
5 Blue =
6 End Enum Private Sub Command1_Click() Dim My_Color As Color " 定義變數My_Color為Color的列舉型別 Dim Back_Color As Color " 定義變數Back_Color為Color的列舉型別 My_Color = Green " 對My_Color賦值 Back_Color = Black " 對Back_Color賦值 Text1.Text = My_Color + Back_Color " 文字框內顯示My_Color + Back_Color的值 End Sub具體的可以參考http://www.d269.com/vbjiaoxue/good_example/chapter2/5.HTM裡面有圖 程式會看的更明白些