S
Sam
Hi everyone
Could anyone help me understand the usage of the "New" keyword I'm new to
VB.Net.
1. Why do we use the "New" keyword on some object type variables such as the
myPen of the example below and not with the bgColor. Both the Pen and Color
are objects
Dim myPen As Pen = New Pen(Color.AquaMarine)
Dim bgColor As Color = Color.LightYellow
2. Why do properties such as Size, Location, Font... of controls require a
new instance of their classes when we want to change their properites at run
time
Thanks
Sam
Could anyone help me understand the usage of the "New" keyword I'm new to
VB.Net.
1. Why do we use the "New" keyword on some object type variables such as the
myPen of the example below and not with the bgColor. Both the Pen and Color
are objects
Dim myPen As Pen = New Pen(Color.AquaMarine)
Dim bgColor As Color = Color.LightYellow
2. Why do properties such as Size, Location, Font... of controls require a
new instance of their classes when we want to change their properites at run
time
Thanks
Sam