📘 Visual Basic - Class 8 CBSE Notes
🔰 Introduction to Visual Basic
- Visual Basic (VB) is a high-level programming language developed by Microsoft.
- It allows you to create Windows-based applications with graphical interfaces.
- It is suitable for beginners and school students.

💡 Event-Driven Programming
- VB uses event-driven programming, meaning code runs based on events like button clicks or mouse moves.
- Events are actions performed by the user that trigger specific responses.
💻 Visual Studio 2017 Express
- Visual Studio Express is an IDE (Integrated Development Environment) by Microsoft.
- It includes tools to design forms, write code, test and debug applications.
🚀 Starting Visual Studio Express
- Go to Start → Search "Visual Studio 2017 Express".
- Click to open the IDE.
- Select "New Project" → Windows Forms App.
🧩 Components of the Window
- Menu Bar – Contains File, Edit, View, etc.
- Toolbox – Provides GUI controls like buttons, labels, textboxes.
- Form – The design area for your application window.
- Properties Window – Used to change the settings of controls.
- Solution Explorer – Displays files in the project.
🔄 Modes of Visual Studio
- Design Mode – Used to design the layout (drag and drop controls).
- Run Mode – Used to test/run the application.
- Break Mode – Used to debug code.
🛠️ Properties, Methods & Events
- Properties – Define control features (Text, Color, Font).
- Methods – Built-in actions (e.g., Show(), Close()).
- Events – Triggered by user actions (Click, Load).
🎛️ Various Controls in VB
- Label – Displays text.
- TextBox – Accepts input from user.
- Button – Performs an action on click.
- CheckBox, RadioButton, PictureBox, ListBox – Other useful controls.
🔠 Label Control
- Used for displaying static information on form.
- Set the Text property to change what it displays.
📝 TextBox Control
- Used to receive input from the user.
- Text property stores what the user typed.
🔘 Button Control
- Used to perform an action when clicked.
- Click event triggers the assigned code.
⚙️ Working with Controls
- Drag control from toolbox to form.
- Select control → Use Properties Window to change its name, text, color, etc.
- Double-click control to write code for its event.
🔧 Changing Properties of Controls
- Click on a control to open its Properties window.
- Change values like Name, Text, Size, Color as needed.
📥 Commonly Used Functions
- MsgBox(): Shows a message box.
MsgBox("Hello Student!")
- InputBox(): Gets input from the user.
name = InputBox("Enter your name")
💾 Saving a VB Application
- Go to File → Save All.
- Choose location and name your project.
📂 Opening an Existing VB Project
- Open Visual Studio → File → Open → Project/Solution.
- Select the .sln (Solution) file to load your project.
No comments:
Post a Comment