1- Date TimePicker 2- Month Calendar 3- User Defined Controls.

Slides:



Advertisements
Similar presentations
Microsoft Expression Web-Illustrated Unit J: Creating Forms.
Advertisements

1. Chapter 29 Creating Forms 3 Understanding Forms Word enables you to create fill-in forms to eliminate the need for storing pre-printed forms. Add.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
© by Pearson Education, Inc. All Rights Reserved. continued …
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
1 Visual Basic.NET Application Overview. 2 Objectives Discuss what a typical Visual Basic.NET application looks like Configure the Visual Studio.NET Integrated.
Chapter 31 Visual Basic Controls A Form is a windows-style screen displayed by Visual Basic programs. In a form, a programmer can create objects in a form.
Compunet Corporation Programming with Visual Basic.NET GUI Week # 11 Tariq Ibn Aziz.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 3 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Chapter 3 Week 13 Tariq Aziz and Kevin Jones.
Getting Started Example ICS2O curriculum
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
1 Graphical User Interfaces Part 2 Outline Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
A First Look At Microsoft Visual Basic Lesson 1. What is Microsoft Visual Basic? Microsoft Visual Basic is a software development tool, which means it.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
 2009 Pearson Education, Inc. All rights reserved Dive Into ® Visual C# 2008 Express.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Computing Fundamentals Module Lesson 3 — Changing Settings and Customizing the Desktop Computer Literacy BASICS.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction It is developed to create software applications. It is a tool for developers of any program that uses both basic and expert settings. It.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Using Microsoft Visual Studio C++ Express 2005 Name: Dr Ju Wang Ashwin Belle Course Resource:
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Chapter 2 – Introduction to the Visual Studio .NET IDE
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 2.1 Test-Driving the Welcome Application 2.2.
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
) Main Menu: You can access all aspects of the database from this screen 2) Contacts: You can access the “contact database management” side of.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
Crystal Reports with MDS  Topics  Crystal Reports  Sales Analysis Reports  Export Crystal Report to different formats  Modify and Save New Reports.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
CS 281 – Fall 2010 Lab 4 Parametric Query and Forms in MS Access.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Import existing part with drawing
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Dive Into® Visual Basic 2010 Express
Date TimePicker, Month Calendar
Tutorial 14 – Shipping Time Application Using DateTimes and Timers
Visual Studio 2010 Hello World CSC 230.
Chapter 1: An Introduction to Visual Basic 2015
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
Data Validation and Protecting Workbook
3.01 Apply Controls Associated With Visual Studio Form
Using Procedures and Exception Handling
Visual Studio 2010 Hello World CSC 230.
Chapter 2 – Introduction to the Visual Studio .NET IDE
1. Open Visual Studio 2008.
Presentation transcript:

1- Date TimePicker 2- Month Calendar 3- User Defined Controls

DateTimePicker DateTimePicker allows us to select date and time. DateTimePicker is based on the control class. When we click on the drop-down arrow on this control it displays a month calendar from which we can make selections. When we make a selection that selection appears in the textbox part of the Date TimePicker.

Notable Properties of Date TimePicker The Format property in the Appearance section is used to select the format of the date and time selected. Default value is long which displays the date in long format. Other values include short, time and custom

Behavior Section The CustomFormat property allows us to set the format for date and time depending on what we like. To use the CustomFormat property we need to set the Format property to Custom. The MaxDate Property allows us to set the maximum date we want the Date TimePicker to hold. Default MaxDate value set by the software is 12/31/9998 The MinDate Property allows us to set the minimum date we want the Date TimePicker to hold. Default MinDate value set by the software is 1/1/1753.

2-MonthCalendar The MonthCalendar control allows us to select date. The difference between a DateTimePicker and MonthCalendar is, in MonthCalendar we select the date visually and in Date TimePicker when we want to make a selection we click on the drop-down arrow and select the date from the MonthCalendar which is displayed.

Notable Behavior properties of MonthCalendar FirstDayOfWeek: Default value is Default which means that the week starts with Sunday as the first day and Saturday as last. You can set the first day of the week depending upon your choice by selecting from the predefined list with this property. ShowToday: Default value is set to True which displays the current date at the bottom of the Calendar. Setting it to False will hide it.

ShowTodayCircle: Default value is set to True which displays a red circle on the current date. Setting it to False will make the circle disappear. ShowWeekNumber: Default is False. Setting it to True will display the week number of the current week in the 52 week year. That will be displayed towards the left side of the control.

Visual Studio.NET allows developers to share their custom controls with other developers. 3- User-Defined Controls

User-Defined Controls To create a UserControl that can be exported to other solutions, do the following: 1. Create a new Windows Control Library project. 2. Inside the project, add controls and functionality to the UserControl

3. Build the project. Visual Studio.NET creates a.dll file for the UserControl in the output directory. The file is not executable. Select Project > Properties to find the output directory and output file. 4. Create a new Windows application. 5. Import the UserControl. In the new Windows application, right click the ToolBox, and select Customize Toolbox.... In the dialog that appears, select the.NET Framework Components tab. Browse for the.dll file, which is in the output directory for the Windows control library project. Click the checkbox next to the control, and click OK User-Defined Controls

6. The UserControl appears on the ToolBox and can be added to the form as if it were any other control. User-Defined Controls

Control classes do not have a Main method— they cannot be run by themselves. To test their functionality, add them to a sample Windows application and run them there. User-Defined Controls

Example Create a UserControl called LoginPasswordUserControl. The LoginPasswordUserControl contains the following: o Label (loginLabel) that displays String “Login:”. o TextBox (loginTextBox) where the user enters a login name. o Label (passwordLabel) that displays the String “Password:” o TextBox (passwordTextBox) where a user inputs a password LoginPasswordUserControl must provide Public read-only properties Login and Password that allow an application to retrieve the user input from a login TextBox. Use the new control in application that displays the values input by the LoginPasswordUserControl. 18

19Solution In order to create LoginPasswordUserControl application, do the following: (Class Library) 1.Custom control (Class Library) Create your custom control “LoginPasswordUserControl” from other predefined controls, TextBoxes and Labels and add required functionality to it. Then it will appears in the user’s ToolBox. (Windows application) 2.Application (Windows application) Share the “LoginPasswordUserControl” by adding it into a Form and add more controls and functionalities.

1.Create a new Class Library named “LoginPasswordUserControl”.

2. Delete the file named “Class1.vb” that is initially provided with the project.

3- Right click the project in the Solution Explorer and select Add> User Control… in the dialog that appears, name the user control “LoginPasswordUserControl” file and click Add.

23 Class Library 4.Design the user control by adding the required controls. TextBox Name: loginTextBox TextBox Name: passwardTextBox Label Name: loginLabel Label Name: passwardLabel

24 Change the PasswardChar property of the passwardTextBox to “ * ”. In order for the TextBoxes to change in the Windows application; change its Modefier property to “Public”

25 5. Build the project and the Visual Studio will create a.dll file in the solution’s bin/Release directory. ( Note: class libraries are not executable files, they are used to define classes that are reused on other executable applications)

1.Create a Windows application and name it “LoginPasswordUserControlApp”. Windows Application

27 Windows Application 2. Right click the Toolbox and select Choose Items…

28 In the dialog, click Browse… and locate the.dll file for the class library you already created in the Class Library (step 6). The item will then appear in the Choose ToolBox Items dialog. If it is not already checked, check this item.

29 Note: By completing step 2, the user control is now listed in the Toolbox, and can be added to the any Form as if it were any other control. You may add more controls and functionality to the Form as needed.

30 3.Add a Button “OK” to your Form. 4.Add functionality to your controls, by adding the following:

31 5 -Build and debug