Blue Theme Orange Theme Green Theme Red Theme
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
Search :       Advanced Search »
Home » Blogs Home » Blog Detail

Shortcut Trick For Get & Set Property

 by Ghanashyam Nayak on Nov 17, 2011

Here I am Showing You That How You Can Get & Set Property Using Shortcut In Visual Studio.
Comments: 0 Views: 836 Printable Version 

Here I am Showing You That How You Can Get & Set Property Using Shortcut In Visual Studio.

write "prop" as shown in below image:

jz.gif

Then it will automatically display intelligence & from that select "prop" & then press TAB key from your keyboard then it will automatically add a code snippet of get & set property.

public int MyProperty { get; set; }


After that you can get & set your property like below code on button click event:
 

private void button1_Click(object sender, EventArgs e)

{
            private int newvar; 
            public int MyProperty
            {
               
get
                {
                    return newvar;
                }
               
set
                {
                    newvar=<<Set Here your Value in integer>>;
                }
            }
}

You can also set & get property in other data type by changing the data type instead of "int" use your data type.
 

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
 
What do you say about this post? Post a comment here
*Title:
*Comment:
 
Comments not available.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor

 Blogger's Profile
Age: Not Available
Location:
Title: Student
Joined: Mar 11, 2011
Education: Masters Degree
 More Blogs from this Blogger
No record available
 Latest Blogs
[Video] OnClose Handler
[Video] Storing and Loading the Window and Toolbar position
The Euclidean Algorithm
Swapping Exe Process
How Exe file is Generated by VS2005 C++ Project?
What is Exe
Header files: Multiple Inclusion problem - Solution B
Header files: Multiple Inclusion problem - Solution A
Header files: Multiple Inclusion problem - Reason
Header files: Multiple Inclusion problem
View all »
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 

 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.