Default Property

  • Thread starter Thread starter Shawn B.
  • Start date Start date
S

Shawn B.

How do I set a default property in C#? In VB we use the default keyword
before the property.


Thanks,
Shawn
 
Shawn,
How do I set a default property in C#? In VB we use the default keyword
before the property.

You use indexer syntax:

public string this[int idx]
{
get { ... }
set { ... }
}



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top