|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Property questionIs it possible to have a property with its GET to public and its SET to
private or friend? or vice versa This was possible in VB6, but as far as I know not in .Net
But, you can simulate it like this: Private fStorageField as string Public Readonly Propery StorageField() As String Get Return fStorageField End Get End Property Private, you use fStorageField (which is RW), and public you use Storagefield (Which is RO) Or, the other way around: Private fStorageField as string Public Writeonly Propery StorageField() As String Set(ByVal value as string) fStorageField = value End Get End Property Private, you use fStorageField (which is RW), and public you use Storagefield (Which is WO) Instead of private, you can also use Friend. Pedro wrote: Show quoteHide quote > Is it possible to have a property with its GET to public and its SET to > private or friend? > > or vice versa > > "Theo Verweij" <tverw***@xs4all.nl> schrieb: It's possible in VB 2005 again!> This was possible in VB6, but as far as I know not in .Net -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> > It's possible in VB 2005 again! And again we saw a feature that was already known in VB6 return to VB.net :-) regardsMichel Posseth [MCP] Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schreef in bericht news:%23DEM9D4oGHA.504@TK2MSFTNGP05.phx.gbl... > "Theo Verweij" <tverw***@xs4all.nl> schrieb: >> This was possible in VB6, but as far as I know not in .Net > > It's possible in VB 2005 again! > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> And thats why I waited till VB2005 before I went away from VB6 ;-)
Michel Posseth [MCP] wrote: Show quoteHide quote >> It's possible in VB 2005 again! > > And again we saw a feature that was already known in VB6 return to VB.net > :-) > > > regards > > Michel Posseth [MCP] > > > "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schreef in bericht > news:%23DEM9D4oGHA.504@TK2MSFTNGP05.phx.gbl... >> "Theo Verweij" <tverw***@xs4all.nl> schrieb: >>> This was possible in VB6, but as far as I know not in .Net >> It's possible in VB 2005 again! >> >> -- >> M S Herfried K. Wagner >> M V P <URL:http://dotnet.mvps.org/> >> V B <URL:http://classicvb.org/petition/> > > Pedro wrote:
> Is it possible to have a property with its GET to public and its SET to Yes. Example from MSDN:> private or friend? > > or vice versa > > public string Name { get { return name; } protected set { name = value; } } Yust learned something today!
It works also in VB! Göran Andersson wrote: Show quoteHide quote > Pedro wrote: >> Is it possible to have a property with its GET to public and its SET >> to private or friend? >> >> or vice versa >> >> > > Yes. Example from MSDN: > > public string Name > { > get > { > return name; > } > protected set > { > name = value; > } > } Right. Sorry about posting C# code in the VB forum.
Theo Verweij wrote: Show quoteHide quote > Yust learned something today! > It works also in VB! > > Göran Andersson wrote: >> Pedro wrote: >>> Is it possible to have a property with its GET to public and its SET >>> to private or friend? >>> >>> or vice versa >>> >>> >> >> Yes. Example from MSDN: >> >> public string Name >> { >> get >> { >> return name; >> } >> protected set >> { >> name = value; >> } >> } >
Programmatically open compmgmt.msc
When the messagebox disappears, it leaves a white square Windows Image Acquisition (WIA) Taking black photos Need to sort an Array Help with logic - system payment method Connect to database in non standard location How to convert ShortPath to longPath? Listview item fontstyle About download files vb express question |
|||||||||||||||||||||||