VB.NET 1.1 Tutorial - The With KeywordThe With keyword allows you to perform a series of statements on a specified object without requalifying the name of the object, for example; With MyLabel .Height = 2000 .Width = 2000 .Text = "This is MyLabel" End With If we were to rewrite this without the With .. End With statement, it would look like this: MyLabel.Height = 2000 MyLabel.Width = 2000 MyLabel.Text = "This is MyLabel" Note Once you have entered a With...End With, you cannot reassign object until you have passed the End With. Therefore, you can access the methods and properties of only the specified object without qualifying them. You can use methods and properties of other objects, but you must qualify them with their object names. ReferencesFor more information on the With Keyword, visit MSDN at microsoft here. What Next?Return to the Tutorial Contents. |