A
Ashok Guduru
Hi,
I'm new to C#. In VB.NET we have With...End With Statement. Often, I need to
perform several different actions on the same object. For example, I may
need to set several properties or execute several methods for the same
object.
Private Sub UpdateForm()
Button1.Text = "OK"
Button1.Visible = True
Button1.Top = 24
Button1.Left = 100
Button1.Enabled = True
Button1.Refresh()
End Sub
You can write the same in short form like this.
Private Sub UpdateForm2()
With Button1
.Text = "OK"
.Visible = True
.Top = 24
.Left = 100
.Enabled = True
.Refresh()
End With
End Sub
Is there any such facility available in C# too?
Regards,
G.Ashok
I'm new to C#. In VB.NET we have With...End With Statement. Often, I need to
perform several different actions on the same object. For example, I may
need to set several properties or execute several methods for the same
object.
Private Sub UpdateForm()
Button1.Text = "OK"
Button1.Visible = True
Button1.Top = 24
Button1.Left = 100
Button1.Enabled = True
Button1.Refresh()
End Sub
You can write the same in short form like this.
Private Sub UpdateForm2()
With Button1
.Text = "OK"
.Visible = True
.Top = 24
.Left = 100
.Enabled = True
.Refresh()
End With
End Sub
Is there any such facility available in C# too?
Regards,
G.Ashok