Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3438098
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:08:45+00:00 2026-05-18T08:08:45+00:00

I have three different Enum and all of three has same identifier but different

  • 0

I have three different Enum and all of three has same identifier but different values. I want to access particular enum based on some condition.

for example:

Public Enum Type1
     Font = 10
     Color = 11 
End Enum

Public Enum Type2
     Font = 20
     Color = 21
End Enum

Public Enum Type3
     Font = 30
     Color = 31
End Enum

And based on certain condition i need to access particular enum. for example,

if(somecondition = 1) 
    return Type1.Font
else if (somecondition = 2)
    return Type2.Font
else if (somecondition = 3)
    return Type3.Font

I need to repeat same logic to access other enum identifier. Is there any way I can write generic method that return me enum value?

for example,

public function GetEnumValue(enumtype, identifier) as integer

  return enumtype.identifier 

end function

Is there any way to write above generic function to return enum value?

Updated: I am looking for method like GetEnumValue(Type1,Font) that returns enum value in integer (in this case 10 for type1.font)

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:08:45+00:00Added an answer on May 18, 2026 at 8:08 am

    Your question is extremely unclear.

    You may be looking for

    return Enum.Parse(enumType, valueName);
    

    Where enumType is a Type object and valueName is a string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three radio buttons with same name and different values.When I click the
I have three different configurations on my project, all three do not require all
I have a table that has three different date columns, so I set each
I have a rails application that has three different types of users and I
Task at hand — I have three versions of some code, developed by different
I have three different development machines. Do I need three different iPhone Developer Program
I'm playing with a GWT/GAE project which will have three different pages, although it
I'm completely stumped on this one. I have three different lists that need to
I have a function that receives three different people objects and generates a new
I have an Android project that branched into three different applications, app-1 , app-2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.