The document provides an overview of the Visual C# 2010 programming language and the Visual Studio integrated development environment (IDE). It describes some of the key windows and tools in Visual Studio used for writing, debugging, and organizing C# code. It then provides examples of how to use common controls like labels, buttons, textboxes, checkboxes, and progress bars in Windows Forms applications. The document is intended to help readers learn the basics of building graphical user interfaces in C# using Visual Studio.
The document discusses various topics related to the Visual Basic integrated development environment (IDE) and controls. It describes starting a new project in Visual Studio, the toolbox and common controls like command buttons, properties windows, and events. It also covers image controls, text boxes, labels, message boxes, grids, and provides examples of using properties and events for controls.
This document discusses Visual Basic and its integrated development environment. It covers starting a new project, common form properties like name, color, and scale, and controls in the toolbox like command buttons, text boxes, and images. It also discusses properties of controls, creating controls and using the name property, properties of command buttons, and the visual basic IDE interface with elements like the solution explorer and output window.
This document discusses various aspects of Visual Basic programming including built-in functions, message boxes, input boxes, controls, properties, events, and methods. It provides information on the MsgBox and InputBox functions, describing their syntax and parameters. It also describes the various controls available in the toolbox like labels, text boxes, command buttons, and lists their common properties, events, and methods.
This document discusses various controls, properties, methods and events in Visual Basic. It begins by describing the toolbox window and the various controls available like labels, textboxes, command buttons etc. It then discusses common properties of controls like name, enabled, visible. Common events like click, change and methods like move, refresh are also covered. The document also provides examples of using various properties and methods of form and pointer objects.
The document provides information on using Visual Basic to create graphical user interface (GUI) applications. It discusses the main components of a Visual Basic application, including forms, controls, properties, methods, and event procedures. It then describes various controls that can be used to build the user interface like text boxes, check boxes, option buttons, list boxes, combo boxes, and image boxes. For each control, it lists common properties, events, and methods.
Visual programming allows creating software applications graphically without writing code. Visual Studio is a development environment for building applications with languages like C#. It contains tools like the toolbox, properties window, and solution explorer. The toolbox has common controls that can be dragged onto forms to build an application's interface. Properties configure the controls and forms. Running the project generates an executable file to distribute the completed application.
The visual studio start page is shown in the figure belowTan Ps
油
The document provides instructions for creating a student information application in Visual Basic. It discusses setting up the project environment, building a user interface with labels and text boxes, and writing code to display data. Key steps include:
1. Creating a new Windows Forms project and setting properties like the form name and font.
2. Adding labels, text boxes, and buttons to the form and setting their name, text, and size properties.
3. Writing code handlers for the button click events to display data in the text boxes using assignment statements.
4. Saving and running the project, and using remarks to document the code. The goal is to display sample student information when buttons are clicked.
The document provides instructions for building a userform in Excel VBA to allow users to enter personal expense data. It describes how to insert a new userform, add controls like text boxes and buttons, set control properties, and write code to validate data entry and save the data to a worksheet. Specifically, it shows how to:
1) Add controls like text boxes, labels, and command buttons to the userform.
2) Write VBA code to validate that required fields are completed and check data types.
3) Write data entered into the userform controls to a worksheet using offset to position the data in cells.
The userform is designed to make data entry easier for users by providing
ITS-16163-Module 8-Graphic User Interface (GUI)oudesign
油
The document discusses creating graphical user interfaces (GUIs) using Tkinter in Python. It explains that Tkinter is a popular GUI toolkit that comes pre-installed with Python. It describes common Tkinter widgets like Frame, Label, Button, Text Entry, Text Box, Check Button, Radio Button, and how to create and configure them. It also covers using grids for layout, message boxes, images, list boxes, and defining functions for interaction between elements. In summary, the document provides an overview of building Python GUIs with Tkinter widgets, geometry managers and interactive functionality.
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET Ujwala Junghare
油
The document discusses forms and controls in Windows applications created using Visual Basic .NET. It covers key topics like:
1) Forms are windows that appear in applications and are represented by the Form class. Controls like buttons and text boxes are added to the form's client area.
2) Event handlers allow code to run when events occur, like a button click. The Button1_Click handler displays text in a text box when its button is clicked.
3) Message boxes and input boxes can be used to display messages and get user input using functions like MsgBox and InputBox or the MessageBox class. Results are returned indicating the user's response.
Visual Programming Lectures using Visual Studio 2015 C# Windows Form Application
Lecturer: Saman M. Almufti / Kurdistan Region, Nawroz University
facebook: https://www.facebook.com/saman.malmufti
The document discusses various features of the Visual Basic Editor in Microsoft Office, including:
1. It describes how to open the Visual Basic Editor from within Word or other Office applications using keyboard shortcuts or menu options.
2. It outlines the main windows of the Visual Basic Editor, including the Project Explorer, Code window, and Object Browser.
3. It provides details on features like Auto List Members, Quick Info, and List Constants that help provide information about code as you work.
This document provides examples of various Visual Basic applications using different controls. It includes 12 short applications demonstrating:
1. Label and text box controls to display input fields.
2. A calculator application using command buttons to perform arithmetic operations on two input numbers.
3. Radio buttons to display options and respond to user selection.
4. A form with text boxes, combo boxes and command buttons to accept user input.
5. A timer control changing the visibility of shapes to simulate traffic lights.
6. Getting user input on a form and displaying marks on another frame.
So in summary, it presents 12 mini-projects to demonstrate common Visual Basic controls and concepts like forms, buttons
The document provides an overview of various user interface controls that can be used when designing a user interface, including text boxes, group boxes, check boxes, radio buttons, picture boxes, and borders and styles. It discusses how to select and work with multiple controls, set tab order and keyboard access keys, and add tooltips.
This tutorial introduces programming in Visual Basic 6.0 through a series of activities that demonstrate the main control structures: sequence, selection (binary and multiway), and iteration (pre- and post-test). The activities guide students to implement fully tested and documented software solutions in a methodical manner, meeting the intended learning outcomes. The tutorial begins by having students set up a project template and main menu to organize their work. Subsequent activities introduce key concepts like variables, data types, functions, and event handlers through hands-on exercises creating programs like a calculator, color changer, and message/input boxes.
This document provides an overview of Visual Basic 6.0 and how to create a basic application. It outlines the objectives of learning Visual Basic and describes key concepts like the event-driven nature of VB applications. The document explains the structure of a VB project, including forms, controls, properties, methods and events. It also demonstrates how to set control properties, write code, declare variables, and use common functions and operators. Finally, it provides examples for creating a stopwatch timer application and a basic text editor application in VB.
Introduction to programming using Visual Basic 6Jeanie Arnoco
油
This document provides an introduction to programming using Visual Basic 6.0. It discusses why VB is a good choice for beginners, describes the basic VB integrated development environment interface and components like forms, objects, and properties. It then walks through a "Hello World" example program to demonstrate creating a form with labels, buttons, and event procedures. The document provides details on formatting text, adding images and colors, and using message boxes before concluding with a suggestion for a pizza ordering program project.
Getting started with the visual basic editorputiadetiara
油
berikut adalah penjelasan tentang bagaimana memulai visual basic application.
oleh :
Ade Tiara Putri
Program Studi S1 Sistem Informasi
Fakultas Sains dan Teknologi
Universitas Islam Negeri Sultan Syarif Kasim Riau
please visit
http://sif.uin-suska.ac.id/
http://fst.uin-suska.ac.id/
http://www.uin-suska.ac.id/
This document provides an overview of forms and controls in Visual Basic. It discusses:
- Forms are containers that hold controls and are used to design graphical user interfaces. Forms display information and receive user input.
- Common form properties include text, size, location, visibility, and border style.
- Controls like labels, textboxes, buttons are placed on forms. Controls have properties for appearance, location, and behavior.
- Events like clicks, text changes, and focus changes can trigger event handlers - code that executes in response to events. Common form and control events are described.
- An example program demonstrates creating a form with controls, setting control properties, and writing event handlers to
The document discusses various Windows Form controls in .NET including their properties, methods, and events. It describes common controls like forms, labels, buttons, textboxes, checkboxes, radiobuttons, comboboxes, and listboxes. For each control, it provides the core details about their intended use, relevant class hierarchies, and some of the most important properties, methods, and events for programming with the control.
This document discusses controls, properties, methods, and events in Visual Basic .NET. It defines controls as user interface elements on a form that can be customized. Controls have properties that describe them, methods that cause actions, and events that are triggered from user interactions. Common controls are described like labels, buttons, and forms. Properties and events for each are outlined, such as the Text property for a label and the Click event for a button. Forms are used to build the user interface and contain other controls.
The document provides details about 12 sample Visual Basic applications to demonstrate the use of various controls and programming concepts in Visual Basic. It includes applications to display labels and textboxes, perform arithmetic operations, use option buttons, create a student form, use timers and shapes, move items between lists, format text, use menus for calculations, print a series, and create a puzzle game. Code snippets are provided for each application example.
This document provides an overview of creating a C# Windows Forms application in Visual Studio. It discusses the two main files - Program.cs and Form1.cs - used to create the application and form. It describes using the toolbar and properties window to design the GUI. Various controls like buttons, textboxes and labels are demonstrated. Handling events like button clicks to add interactivity is covered. Finally, it provides examples of solving common programming problems using the Windows Forms environment.
The document discusses interfacing with end users in ASP.NET. It provides two programming models - Web Forms and WCF Services. Web Forms enables creating user interfaces and application logic, while WCF Services enables remote server-side functionality access. It also discusses creating a basic web form in ASP.NET that displays the current date and time when a button is clicked to demonstrate the Web Forms model. Common controls like labels, textboxes, buttons are also summarized with their properties and events.
This document summarizes a lecture on forms and controls in Visual Basic. It discusses:
- Forms are containers that display a GUI and receive user input. Common form properties include size, location, and visibility.
- Controls like labels, textboxes, and buttons are placed on forms. Controls have properties that configure appearance and behavior. Common events include click and text changed.
- Event procedures are written in code to respond to control and form events. For example, a button click event changes the text color in a textbox.
- The form, controls, properties, and event procedures are used to build a visual interface and process user interactions in an example Visual Basic program.
The document provides instructions for building a userform in Excel VBA to allow users to enter personal expense data. It describes how to insert a new userform, add controls like text boxes and buttons, set control properties, and write code to validate data entry and save the data to a worksheet. Specifically, it shows how to:
1) Add controls like text boxes, labels, and command buttons to the userform.
2) Write VBA code to validate that required fields are completed and check data types.
3) Write data entered into the userform controls to a worksheet using offset to position the data in cells.
The userform is designed to make data entry easier for users by providing
ITS-16163-Module 8-Graphic User Interface (GUI)oudesign
油
The document discusses creating graphical user interfaces (GUIs) using Tkinter in Python. It explains that Tkinter is a popular GUI toolkit that comes pre-installed with Python. It describes common Tkinter widgets like Frame, Label, Button, Text Entry, Text Box, Check Button, Radio Button, and how to create and configure them. It also covers using grids for layout, message boxes, images, list boxes, and defining functions for interaction between elements. In summary, the document provides an overview of building Python GUIs with Tkinter widgets, geometry managers and interactive functionality.
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET Ujwala Junghare
油
The document discusses forms and controls in Windows applications created using Visual Basic .NET. It covers key topics like:
1) Forms are windows that appear in applications and are represented by the Form class. Controls like buttons and text boxes are added to the form's client area.
2) Event handlers allow code to run when events occur, like a button click. The Button1_Click handler displays text in a text box when its button is clicked.
3) Message boxes and input boxes can be used to display messages and get user input using functions like MsgBox and InputBox or the MessageBox class. Results are returned indicating the user's response.
Visual Programming Lectures using Visual Studio 2015 C# Windows Form Application
Lecturer: Saman M. Almufti / Kurdistan Region, Nawroz University
facebook: https://www.facebook.com/saman.malmufti
The document discusses various features of the Visual Basic Editor in Microsoft Office, including:
1. It describes how to open the Visual Basic Editor from within Word or other Office applications using keyboard shortcuts or menu options.
2. It outlines the main windows of the Visual Basic Editor, including the Project Explorer, Code window, and Object Browser.
3. It provides details on features like Auto List Members, Quick Info, and List Constants that help provide information about code as you work.
This document provides examples of various Visual Basic applications using different controls. It includes 12 short applications demonstrating:
1. Label and text box controls to display input fields.
2. A calculator application using command buttons to perform arithmetic operations on two input numbers.
3. Radio buttons to display options and respond to user selection.
4. A form with text boxes, combo boxes and command buttons to accept user input.
5. A timer control changing the visibility of shapes to simulate traffic lights.
6. Getting user input on a form and displaying marks on another frame.
So in summary, it presents 12 mini-projects to demonstrate common Visual Basic controls and concepts like forms, buttons
The document provides an overview of various user interface controls that can be used when designing a user interface, including text boxes, group boxes, check boxes, radio buttons, picture boxes, and borders and styles. It discusses how to select and work with multiple controls, set tab order and keyboard access keys, and add tooltips.
This tutorial introduces programming in Visual Basic 6.0 through a series of activities that demonstrate the main control structures: sequence, selection (binary and multiway), and iteration (pre- and post-test). The activities guide students to implement fully tested and documented software solutions in a methodical manner, meeting the intended learning outcomes. The tutorial begins by having students set up a project template and main menu to organize their work. Subsequent activities introduce key concepts like variables, data types, functions, and event handlers through hands-on exercises creating programs like a calculator, color changer, and message/input boxes.
This document provides an overview of Visual Basic 6.0 and how to create a basic application. It outlines the objectives of learning Visual Basic and describes key concepts like the event-driven nature of VB applications. The document explains the structure of a VB project, including forms, controls, properties, methods and events. It also demonstrates how to set control properties, write code, declare variables, and use common functions and operators. Finally, it provides examples for creating a stopwatch timer application and a basic text editor application in VB.
Introduction to programming using Visual Basic 6Jeanie Arnoco
油
This document provides an introduction to programming using Visual Basic 6.0. It discusses why VB is a good choice for beginners, describes the basic VB integrated development environment interface and components like forms, objects, and properties. It then walks through a "Hello World" example program to demonstrate creating a form with labels, buttons, and event procedures. The document provides details on formatting text, adding images and colors, and using message boxes before concluding with a suggestion for a pizza ordering program project.
Getting started with the visual basic editorputiadetiara
油
berikut adalah penjelasan tentang bagaimana memulai visual basic application.
oleh :
Ade Tiara Putri
Program Studi S1 Sistem Informasi
Fakultas Sains dan Teknologi
Universitas Islam Negeri Sultan Syarif Kasim Riau
please visit
http://sif.uin-suska.ac.id/
http://fst.uin-suska.ac.id/
http://www.uin-suska.ac.id/
This document provides an overview of forms and controls in Visual Basic. It discusses:
- Forms are containers that hold controls and are used to design graphical user interfaces. Forms display information and receive user input.
- Common form properties include text, size, location, visibility, and border style.
- Controls like labels, textboxes, buttons are placed on forms. Controls have properties for appearance, location, and behavior.
- Events like clicks, text changes, and focus changes can trigger event handlers - code that executes in response to events. Common form and control events are described.
- An example program demonstrates creating a form with controls, setting control properties, and writing event handlers to
The document discusses various Windows Form controls in .NET including their properties, methods, and events. It describes common controls like forms, labels, buttons, textboxes, checkboxes, radiobuttons, comboboxes, and listboxes. For each control, it provides the core details about their intended use, relevant class hierarchies, and some of the most important properties, methods, and events for programming with the control.
This document discusses controls, properties, methods, and events in Visual Basic .NET. It defines controls as user interface elements on a form that can be customized. Controls have properties that describe them, methods that cause actions, and events that are triggered from user interactions. Common controls are described like labels, buttons, and forms. Properties and events for each are outlined, such as the Text property for a label and the Click event for a button. Forms are used to build the user interface and contain other controls.
The document provides details about 12 sample Visual Basic applications to demonstrate the use of various controls and programming concepts in Visual Basic. It includes applications to display labels and textboxes, perform arithmetic operations, use option buttons, create a student form, use timers and shapes, move items between lists, format text, use menus for calculations, print a series, and create a puzzle game. Code snippets are provided for each application example.
This document provides an overview of creating a C# Windows Forms application in Visual Studio. It discusses the two main files - Program.cs and Form1.cs - used to create the application and form. It describes using the toolbar and properties window to design the GUI. Various controls like buttons, textboxes and labels are demonstrated. Handling events like button clicks to add interactivity is covered. Finally, it provides examples of solving common programming problems using the Windows Forms environment.
The document discusses interfacing with end users in ASP.NET. It provides two programming models - Web Forms and WCF Services. Web Forms enables creating user interfaces and application logic, while WCF Services enables remote server-side functionality access. It also discusses creating a basic web form in ASP.NET that displays the current date and time when a button is clicked to demonstrate the Web Forms model. Common controls like labels, textboxes, buttons are also summarized with their properties and events.
This document summarizes a lecture on forms and controls in Visual Basic. It discusses:
- Forms are containers that display a GUI and receive user input. Common form properties include size, location, and visibility.
- Controls like labels, textboxes, and buttons are placed on forms. Controls have properties that configure appearance and behavior. Common events include click and text changed.
- Event procedures are written in code to respond to control and form events. For example, a button click event changes the text color in a textbox.
- The form, controls, properties, and event procedures are used to build a visual interface and process user interactions in an example Visual Basic program.
Using social media to learn from conferencesSue Beckingham
油
This infographic shows how social media can be used before, during and after a conference. It can be used to promote the event and to start to build a community prior to the conference. It can be used during the conference to develop connections, share insights of what's going on and as a space to ask and answer questions. It also has the potential to be used post conference to keep the conference conversations going.
THE QUIZ CLUB OF PSGCAS BRINGS TO YOU A LITERATURE QUIZ TODAY.
Turn your fingers to brown while turning the pages of quizzing, get ready for an electrifying quiz set!
QUIZMASTER : SUHITA G, B.Sc NUTRITION AND DIETICS (2023-26 BATCH), THE QUIZ CLUB OF PSGCAS
A measles outbreak originating in West Texas has been linked to confirmed cases in New Mexico, with additional cases reported in Oklahoma and Kansas. 58 individuals have required hospitalization, and 3 deaths, 2 children in Texas and 1 adult in New Mexico. These fatalities mark the first measles-related deaths in the United States since 2015 and the first pediatric measles death since 2003. The YSPH The Virtual Medical Operations Center Briefs (VMOC) were created as a service-learning project by faculty and graduate students at the Yale School of Public Health in response to the 2010 Haiti Earthquake. Each year, the VMOC Briefs are produced by students enrolled in Environmental Health Science Course 581 - Public Health Emergencies: Disaster Planning and Response. These briefs compile diverse information sources including status reports, maps, news articles, and web content into a single, easily digestible document that can be widely shared and used interactively.Key features of this report include:
- Comprehensive Overview: Provides situation updates, maps, relevant news, and web resources.
- Accessibility: Designed for easy reading, wide distribution, and interactive use.
- Collaboration: The unlocked" format enables other responders to share, copy, and adapt it seamlessly.
The students learn by doing, quickly discovering how and where to find critical油information and presenting油it in an easily understood manner.油油
How to configure the retail shop in Odoo 17 Point of SaleCeline George
油
Odoo's Retail Shop is managed by the module Point of Sale(POS). It is a powerful tool designed to streamline and optimize the operations of retail businesses. It provides a comprehensive solution for managing various aspects of a retail store, from inventory and sales to customer management and reporting.
Behold a thrilling general quiz set brought to you by THE QUIZ CLUB OF PSG COLLEGE OF ARTS & SCIENCE, COIMBATORE, made of 26 questions for the each letter of the alphabet and covering everything above the earth and under the sky.
Explore the trivia , knowledge , curiosity
So, get seated for an enthralling quiz ride.
Quizmaster : THANVANTH N A (Batch of 2023-26), THE QUIZ CLUB OF PSG COLLEGE OF ARTS & SCIENCE, Coimbatore
Proteins, Bio similars & Antibodies.pptxAshish Umale
油
The slides describe about the protein along with biosimilar data, which is helpful for the study respect to the subject. antibody is known to be active against antigen to show its action in treatment of various disease condition.
These slides gives you the information regarding the topic of protein, biosimilars and details about antibody in response to the antigen along with targeted drug to the antigen. As this topic data is useful for the students of sem VI who are studying in Bachelor of Pharmacy with respect to the subject Pharmacology III.
Action of Muscles ppt by Priscilla Jasper Vedam Vemavarapu @ASRHMCjaspervedamvemavarap
油
Action of muscles-Anatomy
Contraction and relaxation
Muscle tone
Length and tension relationship
Types of muscle contraction
Active and passive insufficiency
Shunt and sprunt muscles
Agonists
Antagonists
Fixators
Synergists
Enhancing SoTL through Generative AI -- Opportunities and Ethical Considerati...Sue Beckingham
油
This presentation explores the role of generative AI (GenAI) in enhancing the Scholarship of Teaching and Learning (SoTL), using Feltens five principles of good practice as a guiding framework. As educators within higher education institutions increasingly integrate GenAI into teaching and research, it is vital to consider how these tools can support scholarly inquiry into student learning, while remaining contextually grounded, methodologically rigorous, collaborative, and appropriately public.
Through practical examples and case-based scenarios, the session demonstrates how generative GenAI can assist in analysing critical reflection of current practice, enhancing teaching approaches and learning materials, supporting SoTL research design, fostering student partnerships, and amplifying the reach of scholarly outputs. Attendees will gain insights into ethical considerations, opportunities, and limitations of GenAI in SoTL, as well as ideas for integrating GenAI tools into their own scholarly teaching practices. The session invites critical reflection and dialogue about the responsible use of GenAI to enhance teaching, learning, and scholarly impact.
2. 2
Contents
Form
Buttons
Labels
TextBoxes
GroupBoxes
Panels
CheckBoxes
RadioButtons
Font Class
MessageBox
PictureBox
3. 3
Form
The form is the most important element in a
Visual C# Project, since it is the interface
(window) that the user interacts with.
When you first create your project, form1, is
always created at the beginning, meaning that
you cant have a project without a form.
4. 4
What does a form represent in Object
Oriented?
To relate the visual programming to Object
Oriented concept.
The project a namespace
The Form a class
Assume you have a project named Test
Check the Solution Explorer window, and open
file Form1.cs by double clicking on it.
5. 5
What does a form represent in Object
Oriented?
Project Name
Form Name
Form1 Constructor
This method
is pre-
defined to set
the initial
values of all
controls
properties in
the form.
What does a
Partial
modifier mean?
Note here, that Form1
is inherited from a
pre-defined class
Form
6. 6
Partial Modifier
The Partial Modifier is
used to be able to define
the same class in several
files.
This file form1.cs, is
used by the developer to
add his/her own code
and event handlers. And
Form1 class is defined
partially, so where is the
rest of this class?
7. 7
Partial Modifier
Return back to the Solution Explorer, and double click the file
form1.Designer.cs.
Check here, that
the Form1 class
is re-defined
again in this file,
which is not
possible unless
you use the
modifier Partial.
8. 8
Form1.Designer.cs
Why this file is created? And who created it?
This file is automatically created by Visual C#, to
contain all definitions of all controls added to the
form. We will discuss this shortly.
9. 9
Form: Properties
Text: The title of the form
BackColor: The background color of the form.
ForeColor: The color of the font of any control added to the form.
Font: The style of the font of any control added to the form.
Size: Determines the width and height of the form.
Maximum Size: Determines the maximum width and the
maximum height of the form the user can reach at run time.
Minimum Size: Determines the minimum width and the
minimum height of the form the user can reach at run time.
To change any of these properties, you can relate to it by using
the keyword This, or directly. (since you are dealing with a
class here).
10. 10
Form: Default Event
Load: This event occurs at the beginning of the
execution of the project (i.e. when the form is
loaded)
12. 12
Buttons
A Button, is a very common control that you may
find in any program works under Windows.
To add a Button, or any control we will discuss
later, go to the toolbox, then:
Either, double click on it, then it will appear to a
default location on the form.
Or, drag it from the Toolbox and drag it on the
form to the location you desire.
13. 13
A Button in Form1.Designer.cs File
When you add a button, or any control, to your
form, you actually instantiate an object of a
related class.
Meaning button1 is actually an object of a pre-
defined class named Button.
The code needed for this instantiation will be
automatically generated in Form1.Designer.cs file
by the visual C#, as soon as you add the button.
14. 14
A Button in Form1.Designer.cs File
This leads us to the reason why Form1 class is
divided into these two files. Form1.Designer.cs to
be used mainly by the visual C#, and Form1.cs is
to be used by the developer (YOU!).
And of course all controls that we will discuss
later are added in the same way.
15. 15
Button: Properties
Text: The label on the button.
Name: The name of the object (ex: button1)
This name is used in the code when referring to
the object.
Size: Width and height of the
button.
Location: the coordinates
X and Y on the form,
where the button resides.
16. 16
Button: Properties
Enabled: True a control can be accessed by the
user
False a control cannot be accessed by
the user.
Visible: True a control is displayed on the form
False a control is hidden from the
form.
Important Note: The previous properties apply on
almost all controls, and are handled in the same
way.
17. 17
LABELs
A Label is an un-editable text that is added to the
form, to display a certain message or a hint
about a control.
Usually, the label takes the size of the text written
in it and the font size, unless the autosize
property is set to false.
18. 18
Label: Properties
Text: The string displayed by the label.
Autosize:
True the label takes the size of the text written in it.
False you can resize the label as you like in the
design time.
TextAlign Changes the alignment of the text
within the borders of the label. It works properly
when the Autosize property is set to False.
19. 19
Show and Hide Methods
Show()
Hide()
These two methods are almost available for all controls
along with the form itself. If you need to hide a button
for example, you write:
button1.Hide();
To show it again:
button1.Show();
These two methods actually change the value of the
Visible property in the desired control.
20. 20
Changing Properties at Runtime
Each control has certain properties defined for it in the
property window. These properties resembles the
attributes defined in classes.
Each attribute has its own data type and you can assign it
a value.
Any updates you apply on the Property Window (Design-
time) are considered the default values for these
properties.
Sometimes, you need to change some properties at run
time.
There are several ways to change the property value
according to the data type of such a property.
21. 21
How to determine a data type for a
property?
When you need to change a certain property for a
certain control (i.e. assign a new value to it), you
need to write an assignment statement starting with
this property.
Suppose you need to change the text property of a
label, you will start the assignment statement as:
label1.Text =
Now you need to figure out the data type of this
property, just hover the mouse over this property (in
the code), and a tooltip will be displayed to give you
a hint about it.
22. 22
How to determine a data type for a
property?
To find out the data type of property Text:
From the above picture, you can find out that the
Text data type is string.
23. 23
Changing Properties (Basic Data Types)
To change the value of a property that have a basic data type (int, float,
double, decimal, string, char, ..etc.), you can use a simple assignment
statement to provide the value you need.
Ex:
label1.Text = Hello World; // assign a direct value
Or
this.Text = label1.Text;
//changes the title of the form with the Text value in the label
Note: Just make sure that you are assigning the right data type to the
property, or you need to convert it if applicable.
Ex: label1.Text = 215 + ;
//here you will add 215 to the text, but after converting it to a string.
24. 24
Changing Properties (pre-defined
enumeration)
Some properties have pre-defined data types
(enumerations) with several values, so you need
to use these values to change them.
Example, the backColor property.
Note here that BackColor is of
data type Color, this is not
a basic data type,
so you will have to use it to change the property
value.
26. 26
Changing Properties (Composite Properties)
Some properties consist of other several
properties, such as
Font (Name, Size, Style)
Size (width, height)
Location (X, Y)
So, to change these properties, or properties they
consist of, we have to instantiate an object of the
class related to this property.
27. 27
Changing Properties (Composite Properties)
Example: To change the property of a label font.
In this code, you can change the three composite
properties of the font. Here you change the font name
to Arial, the font size to 16 and the style to Bold.
Of course you can change only one of them, by
remaining the others as they are set in the Properties
Window. This will be discussed Later.
28. 28
TextBoxes
A TextBox is an editable control that is mainly
used to enable the user to enter data using
keyboard.
29. 29
TextBox: Properties
Text
Multiline: If true, you can use Enter and add several
lines to the textBox
ScrollBars: In case of Multiline Textboxes, vertical
and horizontal scrollbars can be displayed.
WordWrap:
True The lines wont exceed the borders of the
textbox.
False you can continue writing in the line until you
press Enter.
This property only works when Multiline is activated.
30. 30
TextBox: Properties
Forecolor: The color of the text inside.
Readonly: when True, the user cannot write in
the textbox, but can access it and copy its
contents.
Enabled
PasswordChar: takes a single character as a
value, and this character will be used to mask the
entry in the textbox (password behavior)
UseSystemPasswordChar: If True it masks the
value in PasswordChar, and uses the password
character used by Windows on the current PC.
31. 31
TextBox: Properties
TabIndex: an integer used to order the
navigation between controls, starting from
smaller values to larger ones.
32. 32
TextBox: Default Even
TextChanged: This event takes place when the
user writes or deletes any character in the
textbox.
33. 33
Convert
Take into consideration that Text in a TextBox is
a string. So whenever you need to use it for
numbers, you will have to convert the string.
And whenever you need to assign a numeric
value to a textbox, you will have to convert it to
string.
34. 34
Convert from String to Numeric Value
In the statement below, a syntax error appears,
because you are trying to assign a string into an
integer.
To convert a string into a numeric value:
35. 35
Convert from a numeric value into a string
We have several ways to convert into a string:
37. 37
GroupBoxes
A GroupBox is considered a container. It is used
to gather several controls in one place, were you
can apply several actions on them at the same
time.
Example: groubBox1.Hide();
This method will hide the groupbox and its
contents, without the need to hide each control in
a separate statement.
39. 39
Panels
A Panel is another type of containers, that is used
mainly as the groupbox, but it has extra
properties that dont exist in a groupbox.
40. 40
Panel: Properties
BorderStyle: Can be (None, FixedSingle, Fixed3D)
AutoScroll: if True, the scrollbars will appear if
the controls inside the panel exceed its borders.
41. 41
CheckBoxes
CheckBoxes are used to give several options to a
user to check or uncheck. The user can select
only one or several of them, or can unselect all of
them.
43. 43
CheckBox: Default Event
CheckedChanged
This event takes place whenever the Checked
Property is changed either to True or False.
44. 44
RadioButton: Properties/Default Event
Properties:
Checked
True
False
Default Event
CheckedChanged: Takes place when the checked
property is changed to True or False.
45. 45
RadioButtons
RadioButtons are used to give several options to user, but the
user have to choose only one of each group. To separate several
radiobuttons into several groups, we can use any of the
containers in Visual C#, such as: GroupBox, Panel and the Form
itself.
46. 46
Font Classs
To change the font of a certain control, for
example a label or a textbox, we instantiate an
object from Font Class, and send the new values
of (FontName, FontSize and FontStyle).
But, in this statement, we change all the 3 values
at the same time.
47. 47
Font Class - Cont.
To change the style alone, for example, we
remain the other values as defined.
But, in the previous statement, the FontStyle is
changed into Bold, regardless of the style that
already is applied to the label.
48. 48
Font Class - Cont.
To change the FontStyle while reserving the
current style, we will use the XOR operator (^), as
in the following example:
50. 50
MessageBox
To show a message dialog to the user, we will use
MessageBox class along with the method Show().
MessageBox.Show() method is overloaded into
several methods, but we will use in this course
the following method, to display the following
message:
In this method, we send the message
text, the message title, number and
types of buttons to be displayed, and
the icon.
51. 51
MessageBox User Respond
In the previous example, we only show a
message, and dont handle the respond of the
user (i.e. whither the user clicked OK or
CANCEL).
To handle the user respond, we need to define a
variable of type DialogResult, as in the following
example
53. 53
PictureBox and Properties
A PictureBox is
used to display an
image to the user.
Properties:
Image: where the
selected image file
resides. You can
import an image
from your PC.
54. 54
PictureBox: Properties
SizeMode: Determines
how the image is
displayed in the
pictureBox.
Normal: Displays the
topleft corner of the
original image, according
to the size of the
picurebox.
StretchImage: Changes
the ratios of the original
image to fit exactly in the
pictureBox.
AutoSize: changes the size
of the PictureBox,
according to the size of
the original image.
CenterImage: crops a part
of the original image from
its center according to the
size of the PictureBox.
Zoom: Changes the size of
the original image, to fit
in the PictureBox, but
with reserving the ratios
of the image.
55. 55
PictureBox Default Event and Method
Default Event:
Click: occurs when
the user clicks on the
image using mouse.
Method:
FromFile: This
method is used to
change the displayed
image at runtime.
Important Note: Make sure to write the path
in a correct way, so that the program can find
the actual file. Also, make sure to write the
correct extension of the image.