我已經使用枚舉類型的數據類型來添加字符串元素在Windows窗體c#中的組合框,但添加元素在其中的錯誤已經發生。 錯誤的是(「識別符預期」) 我的代碼是如何將字符串項添加到c#中的枚舉?
public enum EducationG
{
("Bachelor of Arts (B.A)"),
("Bachelor of Arts (Bachelor of Education (B.A. B.Ed)")],
("Bachelor of Arts (Bachelor of Law (B.A.B.L)"),
("Bachelor of Arts (Bachelor of Law (B.A.LLB)"),
("Bachelor of Ayurvedic Medicine and Surgery (B.A.M.S)"),
("Bachelor of Applied Sciences (B.A.S)"),
("Bachelor of Audiology and Speech Language Pathology (B.A.S.L.P)"),
("Bachelor of Architecture (B.Arch)"),
("Bachelor of Business Administration (B.B.A)"),
("Bachelor of Business Administration (Bachelor of Law (B.B.A LL.B)"),
("Bachelor of Business Management (B.B.M)"),
("Bachelor of Business Studies (B.B.S)"),
("Bachelor of Computer Applications (B.C.A)"),
("Bachelor of Communication Journalism (B.C.J)"),
("Bachelor of Computer Science (B.C.S)")
}
枚舉不能包含字符串文字。你想做什麼? –
http://msdn.microsoft.com/en-us/library/sbbt4032%28v=vs.80%29.aspx – Kashif
我想使用forloop將字符串元素添加到我的Windows窗體的組合框中 – VJain