Is there a way to combine Enums in VB.net?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
I believe what you want is a flag type enum.
You need to add the Flags attribute to the top of the enum, and then you can combine enums with the ‘Or’ keyword.
Like this:
Note: The numbers to the right are always twice as big (powers of 2) – this is needed to be able to separate the individual flags that have been set.
Combine the desired flags using the Or keyword:
This sets TitleBar and Readonly into the enum
To check what’s been set: