我想知道在C#中是否有一個命令,我可以在Delphi中使用像with command
?是否有一個相當於德爾福在C#中的「with」命令?
// like this :
with(textbox1)
{
.text="some text as text of text box";
.tag=1231;
}
在Delphi
//
with edit1 do
begin
text="some text as text of edit1";
tag=1231;
end;
任何C#基礎教程應該以及如何使用它們... – RBA 2011-05-19 08:08:11
至於其他的答案都正確地指出了基本的關鍵字這個構造在C#中不存在,但是它存在於Visual Basic .NET中 – MattDavey 2011-05-19 08:10:41
@Matt更好的是,VB等價物具有解決Pascal「with」問題的大部分問題的語法。 – 2011-05-19 09:33:43