Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all visitors,
I have created a class in C#. I declare some variables and in front of the variable I use the Static keyword. The variable will remember the value across all instances of that class. I want to create something like this in a VB.net class, but when I use the Static keyword it will give me an error and let me change it from Static to Dim.

Can anybody help me?

Best Regards.
Posted
Updated 29-Mar-11 21:16pm
v2
Comments
johannesnestler 30-Mar-11 5:27am    
Hmm.. I'd have found this information much faster with google than posting a question here. Anyway: A nice trick to "translate" c# to vb.net is using Reflector (or a similar tool). Write code in C# and reflect in vb.net - not perfect but it should give you an idea.

1 solution

Use "Shared" and read all about it here: http://msdn.microsoft.com/en-us/library/ms973875.aspx#methodscope_topic7[^].

Best Regards,
 
Share this answer
 
Comments
soeun tony 30-Mar-11 3:18am    
Thanks for ur reply
This is what i want.
Manfred Rudolf Bihy 30-Mar-11 3:25am    
Great! Please mark the solution as being the answer and also consider voting.
Thank you!
Sergey Alexandrovich Kryukov 30-Mar-11 3:29am    
Sure, a 5.
--SA
m@dhu 30-Mar-11 3:31am    
Good link.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900