Vb.net should i use me




















Connect and share knowledge within a single location that is structured and easy to search. Does 'Me' in VB. NET refer only to an instantiation of the type? Just occurred to me that since I can reference properties in my VB. NET class without using 'Me', that I don't see a reason for using it for this purpose. Will referencing the variable either way always refer to the actual stored value for the property at runtime? The Me keyword behaves like either an object variable or a structure variable referring to the current instance.

You can use it to unambiguously refer to a member of this class. This allows local variables to use the same name, though this is poor practice. And you can use it within the class to use this instance of the object as a parameter in a method call. And to complete the example, here's the full implementation of the Name property so that it raises the NameChanged event. Sign up to join this community.

The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. NET refer to the instantiated object only? Thanks in advance. Add a comment. Active Oldest Votes. In some cases it is required, let's take for example a variable in the scope of a class, and a parameter being passed to a sub-routine that has an equivalent name like so: Private theString As String Private Sub Setup ByVal theString As String Me.

Kezzer Kezzer John John I think for UI controls its very much user's preference. Well, Even though it has things, there are events that this ME keyword provides problems For Example, If you have a form and you invoke it from other form like Dim myform as new frmXXX myform.

In the PrimaryKey method property writeonly primarykey set Siddharth Rout k 15 15 gold badges silver badges bronze badges. Me is a object of current class. Dhiraj Dhiraj 21 2 2 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile.

Related 9. Privacy policy. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info.

Contents Exit focus mode. Is this page helpful? Yes No. Any additional feedback?



0コメント

  • 1000 / 1000