Student Lab Activity CIS170A Lab 1 Of 7 Windows

Student Lab Activity A Lab Cis170a A1b Lab 1 Of 7 Windows For

This assignment involves developing a Windows Forms application using Visual Basic .NET in Visual Studio, focusing on basic control display, property modification, and event handling. The task includes creating a simple "flash card" style training interface that demonstrates controls such as labels and buttons, modifying their properties, and implementing event handlers. The project requires test data demonstration with screenshots, compilation output verification, and zip file submission.

The activity is divided into two parts:

  1. Part A: Developing a basic Windows Form application with controls like Label and Button, configuring properties, and coding a button click event to display a greeting message. The process involves creating the project, designing the form, adding controls, renaming controls meaningfully, and implementing event handlers to update control properties dynamically.
  2. Part B: Building a grade distribution calculator that displays point ranges and percentages for letter grades. It involves creating buttons for each grade, labels for points and percentages, and text boxes or labels to show the outputs. Event handlers update these labels when the grade buttons are clicked and provide functionality for clearing outputs and closing the application.

Deliverables include zipped project files, a Word document with embedded code snippets and screenshots of test data and build output, and submission into the designated Dropbox folder.

Paper For Above instruction

This paper explores the development of basic Windows Forms applications in Visual Basic .NET, emphasizing control manipulation, event handling, and user interface design. The primary goal is to create interactive applications that demonstrate fundamental programming concepts within a visual development environment, fostering both technical skills and user interface understanding.

Introduction

Graphical user interfaces (GUIs) are integral to modern software design, providing intuitive interactions for users. Visual Basic .NET, integrated within Visual Studio, offers a streamlined environment for building Windows Forms applications that help users perform specific tasks effortlessly. Developing such applications encompasses creating controls, modifying their properties, and scripting responses to user actions through event handlers. This approach not only enhances programming proficiency but also aligns with industry standards for user-centered design.

Part A: Building a Simple Greeting Application

The first phase of the project involves constructing a straightforward Windows Form that features a label and a button. The label displays a welcoming message, and clicking the button updates this message dynamically to include the user's name. The process begins with creating a new Windows Form project, which Visual Studio facilitates through a guided interface. Once the project is initialized, the developer designs the form by adding controls from the Toolbox, primarily a Label and a Button, and customizes their properties such as Name and Text to ensure meaningful identifiers.

Naming controls systematically is crucial for clarity and ease of coding. For example, the label might be named lblGreeting, and the button named btnSayHello. Adjusting the properties, particularly Text, ensures the controls display the correct prompts to users. The developer then implements the button's Click event handler. Double-clicking the button in design mode generates an automatically linked method stub, where the programmer inserts code to update the label's Text property. For instance, the code might set lblGreeting.Text = "Hello, my name is [Your Name]" to personalize the interface.

The program is tested by running it within the IDE, verifying that clicking the button updates the label appropriately. It is essential to observe the correct build process by checking the output messages for errors or warnings before executing the program. Successful compilation and execution demonstrate that the application responds correctly to user inputs, fulfilling the fundamental programming and interface design objectives.

Part B: Grade Distribution Calculator

The second portion shifts focus to creating an application that assists users in understanding grade point ranges and corresponding percentages. The form includes multiple buttons, each representing a letter grade from A to F, along with labels indicating points and percentage ranges. Additional control buttons, such as Clear and Exit, facilitate user management of the displayed data. The design phase involves systematically adding these controls to the form, assigning logical names like btnGradeA, lblPoints, and lblPercent, and setting their initial Text properties to descriptive labels or empty strings.

Event handlers are systematically assigned to each grade button. When a button is clicked, the handler updates the points and percentage labels to reflect the grade's range, such as "900–1,000" and "90%–100%". The Clear button resets the display labels to blank, allowing for new inputs or tests, while the Exit button closes the application using the Me.Close() method. Throughout development, proper control naming, property setting, and event programming are essential for creating a responsive and user-friendly interface.

Testing the application involves clicking each grade button and verifying the displayed data, capturing screenshots to document the functionality. Additionally, the program is built and checked for errors before final submission. Documentation includes embedding the code into a Word file alongside screenshots of the application's test runs and build messages. The comprehensive approach ensures clarity, correctness, and usability of the final product.

Conclusion

Developing Windows Forms applications in Visual Basic .NET forms a foundational step in mastering GUI programming. The tasks of designing forms, adding and configuring controls, and writing event handlers mirror real-world application development, emphasizing systematic coding practices. The project illustrates the importance of control naming conventions, property management, and event-driven programming, which are vital skills for software engineers. Proper testing, debugging, and documentation ensure the application's robustness and readiness for deployment or further development.

Overall, these exercises exemplify core programming concepts—user interface design, event handling, data representation—which are essential in creating interactive applications. The skills gained pave the way for developing more complex systems and contribute significantly to understanding software development life cycles within the Microsoft Visual Basic environment.

References

  • Albahari, J., & Albahari, M. (2011). C# 5.0 in a Nutshell: The Definitive Reference. O'Reilly Media.
  • Gurusamy, S. (2014). Visual Basic Programming: Learn Visual Basic in 24 Hours. Guru99 Publishing.
  • Heffner, S. (2010). Programming Visual Basic 2010. O'Reilly Media.
  • Johnson, S. (2013). Essential Windows Forms in C# and VB.NET. McGraw-Hill Education.
  • Keller, J. (2012). Professional Visual Basic 2010. Wrox Press.
  • McConnell, S. (2004). Code Complete. Microsoft Press.
  • Microsoft Docs. (2023). Introduction to Windows Forms in .NET. Retrieved from https://docs.microsoft.com/en-us/dotnet/desktop/winforms/overview/?view=windowsdesktop-7.0
  • Rothstein, B. (2010). Microsoft Windows Forms Programming in Visual Basic. Pearson.
  • Syed, S. (2015). VB.NET Programming for Beginners. VB.NET Programming Series.
  • Yoder, S. (2016). Build Your Own Windows Forms Applications. Apress.