You are developing a utility screen for a new client application. The utility screen displays a thermometer that conveys the current status of processes being carried out by the application. You need to draw a rectangle on the screen to serve as the background of the thermometer as shown in the exhibit. The rectangle must be filled with gradient shading. (Click the Exhibit button.) Which code segment should you choose?
A.
Dim objRect As New Rectangle(10, 10, 450, 25)Dim objBrush As New LinearGradientBrush( _ objRect, Color.AliceBlue, Color.CornflowerBlue, _ LinearGradientMode.ForwardDiagonal)Dim objPen As New Pen(objBrush)Dim g As Graphics = myForm.CreateGraphicsg.DrawRectangle(objPen, objRect)
B.
Dim objRect As New Rectangle(10, 10, 450, 25)Dim objBrush As New LinearGradientBrush( _ objRect, Color.AliceBlue, Color.CornflowerBlue, _ LinearGradientMode.ForwardDiagonal)Dim objPen As New Pen(objBrush)Dim g As Graphics = myForm.CreateGraphicsg.FillRectangle(objBrush, objRect)
C.
Dim objRect As New RectangleF(10.0F, 10.0F, 450.0F, 25.0F)Dim points() As System.Drawing.Point = _ {New Point(0, 0), New Point(110, 145)}Dim objBrush As New LinearGradientBrush( _ objRect, Color.AliceBlue, Color.CornflowerBlue, _ LinearGradientMode.ForwardDiagonal)Dim objPen As New Pen(objBrush)Dim g As Graphics = myForm.CreateGraphicsg.DrawPolygon(objPen, points)
D.
Dim objRect As New Rectangle(10, 10, 450, 25)Dim objBrush As New SolidBrush(Color.AliceBlue)Dim objPen As New Pen(objBrush)Dim g As Graphics = myForm.CreateGraphicsg.DrawRectangle(objPen, objRect)