Use of With Statement in

Posted by Satyapriyanayak under VB.NET category on | Points: 40 | Views : 789
It executes a series of statements making repeated reference to a single object.

Public Class Form1
Inherits System.Windows.Forms.Form

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
With TextBox1
.Text = "How to use with statement"
.BackColor = Color.Red
.ForeColor = Color.Yellow
End With
End Sub

Comments or Responses

Login to post response