"Duggi" <Du***************@gmail.comwrote in message
news:04**********************************@s9g2000p rg.googlegroups.com...
I have a class with an indexer in the class. The code code is in C#.
However I was trying to access the indexer in the other lang of .Net,
VB. I ran into some indexer related issues (I believe they are because
of indexer)
Does any one can give me procedure to do the above?
When you define an indexer in C#, it is accessed from VB.Net as "Item".
For instance:
[C#]
class Whatever
{
public string this[int p]
{
get { ...; }
}
}
....
Whatever x = new Whatever();
string result = x[7];
[VB]
Dim x as New Whatever()
Dim result as String = x.Item(7)