Is there an equivalent for Delphi's “with” command in c#?

前端 未结 5 533
借酒劲吻你
借酒劲吻你 2021-01-17 17:52

I was wondering if there is a command in C# which I can use like with command in Delphi?

// like this :
with(textbox1)
{
   .text=\"some text as         


        
5条回答
  •  被撕碎了的回忆
    2021-01-17 18:11

    No but depending on what you are trying to do, the following would work:

    TextBox t = textbox1;
    
    t.text="some text as text of text box";
    t.tag=1231;
    

提交回复
热议问题