.:: Jasa Membuat Aplikasi Website,Desktop,Android Order Now..!! | | Order Now..!! Jasa Membuat Project Arduino,Robotic,Print 3D ::.

Public Enum inside Module in VB.NET

0 komentar


بِسْــــــــــــــــمِ اﷲِالرَّحْمَنِ اارَّحِيم
bismillaahirrahmaanirrahiim

السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
Assalamu'alaikum warahmatullahi wabarakatuh

Public Enum inside Module in VB.NET


'choice' cannot expose type 'Module1.Enum_choice' outside the project through class 'Class1'



You have this error but you don�t know why. You have an Enumeration inside a Module and you want to use it inside a class. Why this isn�t working?

I have a sample project at the end of this post if you want to experiment the case.
First of all, if you have this problem, it is probably that you haven�t told the program that your module is public. You could easily correct the problem by adding the keyword PUBLIC at the beginning of your Module.

Assuming the module and the class are in the same project.

In yellow, the error you might have:


Public Class Class1
    Private _Choice As Enum_Choice
    Public Sub New()
        _Choice = Enum_choice.none
    End Sub

    Public Sub New(choice As Enum_choice)
        _Choice = choice
    End Sub
End Class



Here is the error I copy from Microsoft Visual Studio 2010:

Error      1             'choice' cannot expose type 'Module1.Enum_choice' outside the project through class 'Class1'.                C:\Users\checkkay\Documents\Visual Studio 2010\Projects\GlobalEnumSample\GlobalEnumSample\Class1.vb                7             30           GlobalEnumSample


The solution for you problem is in Yellow. You have to tell your program that the Enumeration is accessible.

Public Module Module1
    Public Enum Enum_choice
        none = 0
        first = 1
        twice = 2
    End Enum
End Module



Download sample Project:  GlobalEnumSample.zip

I work with Microsoft Visual Studio 2010 for most of my projects. You could get or download it from this link: Download Visual Studio or Express Edition

You could also buy the same version I am using from Amazon here: Visual Studio 2010 Professional (Old Version)
Microsoft Visual Studio 2012 Professional is now cheaper than the older version. If you want to buy it, I advise you to buy the newer version. If you want to compare both versions, I made a little post on the subject here: VS2010 vs VS2012



Others interesting post on Modules:



Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
NB :: Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code, membeli hardware elektronika untuk kepentingan Perusahaan maupun Tugas Akhir (TA/SKRIPSI), Insyaallah Saya siap membantu, untuk Respon Cepat dapat menghubungi kami, melalui :

No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com


atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِين
Alhamdulilah hirobil alamin

وَ السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
wassalamualaikum warahmatullahi wabarakatuh


Artikel Public Enum inside Module in VB.NET, Diterbitkan oleh scodeaplikasi pada Kamis, 16 Mei 2013. Semoga artikel ini dapat menambah wawasan Anda. Website ini dipost dari beberapa sumber, bisa cek disini sumber, Sobat diperbolehkan mengcopy paste / menyebar luaskan artikel ini, karena segala yang dipost di public adalah milik public. Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code ,Dengan Cara menghubungi saya Ke Email: Fajarudinsidik@gmail.com, atau No Hp/WA : (fajar) : 085369237896, (puat) : 085267792168.

Tawk.to