S
I can't find it .. what am I missing?
Nicholas Paldino said:Sahil,
It's not a C# feature, but a VB feature. What are you trying to do?
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Sahil Malik said:
Rob Windsor said:The closest equivalent in C# is to put the type you want to cast to in
parenthesis in front of the reference variable you want to cast. Note that
both will fail with an exception if the cast is invalid.
Dim tb As TextBox
tb = DirectCast(Sender, TextBox)
TextBox tb;
tb = (TextBox)sender;
--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada
http://msmvps.com/windsor/
Sahil Malik said:
Rob Windsor said:The closest equivalent in C# is to put the type you want to cast to in
parenthesis in front of the reference variable you want to cast. Note that
both will fail with an exception if the cast is invalid.
Dim tb As TextBox
tb = DirectCast(Sender, TextBox)
TextBox tb;
tb = (TextBox)sender;
--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada
http://msmvps.com/windsor/
Sahil Malik said:
Abhijeet Dev said:should not we use tb = (sender as TextBox);
and then check if tb is null
Rob Windsor said:The closest equivalent in C# is to put the type you want to cast to in
parenthesis in front of the reference variable you want to cast. Note
that both will fail with an exception if the cast is invalid.
Dim tb As TextBox
tb = DirectCast(Sender, TextBox)
TextBox tb;
tb = (TextBox)sender;
--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada
http://msmvps.com/windsor/
Sahil Malik said: