Question: The Internet contains a vast amount of code snippets that you can use in your Visual Basic applications. And in many cases, you can use
The Internet contains a vast amount of code snippets that you can use in your Visual Basic applications. And in many cases, you can use the snippet without fully understanding each line of its code. In this exercise, you will use a code snippet that rounds the corners on a splash screen.
a. Open the Rounded Corners Solution (Rounded Corners Solution.sln) file contained in the VB2015\Chap01\Rounded Corners Solution folder. If necessary, open the designer window. The image that appears on the form is displayed by the form’s BackgroundImage property. The form’s BackgroundImageLayout property is set to Stretch.
b. For the code snippet to work properly, the splash screen cannot have a border. Therefore, change the form’s FormBorderStyle property to None.
c. Save the application and then start the solution. Notice that the splash screen contains the standard corners, which are not rounded. Click the Exit button to end the application.
d. Open the Code Editor window. Select (highlight) the lines of code contained in the form’s Load event procedure, which is processed when the application is run and the form is loaded into the computer’s internal memory. See Figure 1-36.
![Start Uncomment the selected lines button Main Form.vb x Main Form v [Design] O Rounded Cormers Project End Sub frmMain a, InitialiteCormponent](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1608/1/9/9/3315fdb2ca3763ca1608199330446.jpg)
e. Click the Uncomment the selected lines button on the Standard toolbar. (Refer to Figure 1-36 for the button’s location.) Save the solution and then start the application. The splash screen now has rounded corners. See Figure 1-37.

f. Click the Exit button to end the application. Close the Code Editor window and then close the solution.
Start Uncomment the selected lines button Main Form.vb x Main Form v [Design] O Rounded Cormers Project End Sub frmMain a, InitialiteCormponent "Private Sub frimMain_Load (sender As Object, e As Eventrgs) Handles Me.Load Dim p As New Drawing2D.GraphicsPath() p.StartFigure() p. AddArc (New Rectangle(e, 0, 4e, 40), 180, 98) p. Addline(40, e, Me.Width - 40, a) p. Addarc (New Rectangle(Me.width - 40, e, 40, 40), -98, 98) p.AddLine(Me.Width, 40, Me.Width, Me. Height - 40) p. Addarc(New Rectangle(Me. Width - 40, Me.Height p. AddLine(Me.Width - 49, Me. Height, 40, Me. Height) p. AddArc (New Rectangle(0, Me.Height - 40, 40, 48), 90, 90) p.CloseFigure() Me. Region = New Region(p) 40, 40, 40), e, 90) End Sub
Step by Step Solution
3.36 Rating (165 Votes )
There are 3 Steps involved in it
af Microsoft Visual Studio Solution File Format Version 1200 Visual Studio 14 VisualStudioVersion 140225120 MinimumVisualStudioVersion 100402191 ProjectF184B08FC81C45F6A57F5ABD9991F28F Rounded Corners ... View full answer
Get step-by-step solutions from verified subject matter experts
