Using VB's "With" in C#

  • Thread starter Thread starter John S
  • Start date Start date
J

John S

In VB, you could start manipulating a controls properites and methods
just by using the statement
With <control name>
..Text=gnkn
end with

Does anyone know if there is anything similar in C#
 
Does anyone know if there is anything similar in C#

not really... the closest thing you can do is :
//***
TextBox t = this.txtMyTextBox;
t.Text. = gnkn;
t.ForeColor = Color.Red;
//...
//***
 
Back
Top