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 text of text box";
.tag=1231;
}
// in Delphi
with edit1 do
begin
text="some text as text of edit1";
tag=1231;
end;
No, that does not exist in C#.
No, it does not exist in C#, however, when creating an object, you can do like this:
var textbox1 = new TextBox {
Text = "some text as text of text box";
Tag = 1231
};
Not for already created instances.
However, when you create a new instance you can do:
var textbox1 =
new Textbox
{
Text = "some text as text of text box",
Tag = 1231
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With