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;
//...
//***
 

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