Answer: GetName is a static method,so we can directly access this by Enum_Name.GetName as shown below:-
MsgBox([Enum].GetName(GetType(Active_Inactive),1)) //Where 1 is an Index Position of Enum Values
Output:-
Active
MessageBox.Show(Enum.GetName(typeof(Active_Inactive),2));
Output:-
Inactive
Asked In: Many Interviews |
Alert Moderator