В проекте рассмотрены функции даты и времени: текущие дата и время, день недели, день месяца, день года, проверка на високосный год, максимальное и минимальное.

Slides:



Advertisements
Similar presentations
Chapter 6 - VB 2005 by Schneider1 Do Loop Syntax Do While condition statement(s) Loop Condition is tested, If it is True, the loop is run. If it is False,
Advertisements

Chapter 6, Slide 1Starting Out with Visual Basic 3 rd Edition Chapter 6 Sub Procedures And Functions.
Naredba If..Then..Else... Procedure TForm1.Button1Click ( SEnder: Tobject ); Var x, y, Max : Integer; Begin x := StrToInt ( Edit1.Text ); y := StrToInt.
5.04 Apply Decision Making Structures
Arfansyah, M.Kom. Listview : digunakan untuk menampilkan data yang bentuknya jamak.
Practical Programming COMP153-08S Lecture: Repetition Continued.
The Days Of The Week Origin.
Multiple Forms & Procedures. Form Methods: –Show, Hide, Activate, Close Events: –Load, Activated, Closing, Closed.
More on lists, exceptions, loops and validation. You can use the exception to indicate the error that occurred Private Sub btnCheck_Click(ByVal sender.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
3-1 Chapter 3 Variables, Assignment Statements, and Arithmetic.
COMPUTER PROGRAMMING I Objective 7.04 Apply Built-in String Functions (3%)
Variable, Expressions, Statements and Operators By: Engr. Faisal ur Rehman CE-105 Fall 2007.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
COMPUTER PROGRAMMING I Objective 7.03 Apply Built-in Math Class Functions.
1 CC111 Lec9 : Visual Basic Visual Basic (3) Lecture 9.
VB Procedures. Procedures. Sub procedure: Private/Public Sub SubName(Arguments) … End Sub Private: Can only be accessed by procedures in the same form.
COMPUTER PROGRAMMING I SUMMER Apply operators and Boolean expressions.
Programming Test #1 Solutions. Multiple Choice 1. B) the grammar of the coding language 2. C) String 3. A) Single 4. C) 2Burgers4Me 5. B) Design Time.
Do Loop with Interest Please see speaker notes for additional information!
1 Week 6 The Repetition Structure. 2 The Repetition Structure (Looping) Lesson A Objectives After completing this lesson, you will be able to:  Code.
Tutorial 6 The Repetition Structure
CS0004: Introduction to Programming Project 1 – Lessons Learned.
6c – Function Procedures Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
COMPUTER PROGRAMMING I SUMMER Apply operators and Boolean expressions.
If (UCSRA & 0x80 ) { switch(ch) case ‘u’: while ( aileronleft > 1) { lcd_clrscr(); lcd_gotoxy(1,0); lcd_puts("SW1 depressed"); x = x - 4; if ( x < 1000)
1 Week 5 More on the Selection Structure. 2 Nested, If/ElseIf/Else, and Case Selection Structures Lesson A Objectives After completing this lesson, you.
1 Advanced Computer Programming Lab Calculator Project.
4-1 Chapter 4 The Selection Process in VB.NET. 4-2 Learning Objectives Understand the importance of the selection process in programming. Describe the.
Pay Example (PFirst98) Please use speaker notes for additional information!
PRACTICE SAC 1 Some solutions. 'inputs 'sale price 'postcode 'coupon codes 'processing 'calculate commissions (commission based on cost) 'calculate postage.
Created by Alia Al-Abdulkarim 2008 Visual Basic Vs. Java.
COMPUTER PROGRAMMING I 5.04 Apply Decision Making Structures.
COMPUTER PROGRAMMING I SUMMER Apply operators and Boolean expressions.
6b – Sub Procedure With Parameters Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
CIS 375—Web App Dev II ASP.NET 5 Events. 2 The Page_Load Event The Page_Load event is triggered when a page loads. [Example]Example Sub Page_Load lbl1.Text="The.
JavaScript Встроенные объекты String Math Date.
REM function that gets called when the network changes Private Sub OnNetworkChange (ByVal s As Object, _ ByVal a As EventArgs) REM Perform detection.
Подготовила материал: Ниязова Светлана Леоновна Место работы: ГККП «Ясли-сад № 93» города Павлодара Должность: учитель -логопед Ребусы «Дни недели» для.
Parts of the Clock Click on the minute hand. Click on the clock’s face.
MIC305 Week 6 Beyond controls Review of properties Differences with VB6: using classes and instances Programming constructs.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3 Variables and Calculations.
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
IS 350 Strings and Dates. Slide 2 Objectives Understand character-encoding systems and use the Char data type Use the String data type Call members of.
Computer Science Up Down Controls, Decisions and Random Numbers.
COM148X1 Interactive Programming Lecture 4. Topics Today DateTime Functions Using Module Using Procedure Using Function Pass by Value and Pass by Reference.
Use TryParse to Validate User Input
Visual Basic Fundamental Concepts
Objective 7.04 Apply Built-in String Functions (3%)
Use TryParse to Validate User Input
Introduction to VB programming
للمزيد زورونا على موقعنا الإلكتروني:
Visual Basic..
Boolean Expressions and If statements
Department Array in Visual Basic
Working with DateTime Data
Back Cover Cover Page Page 1-Triple click in this textbox and enter your information for Page 1 of your book. Page2-Triple click in this textbox and enter.
1.الدوال Function 2.الاجراءاتSub Procedure 3.وحده نمطيه Add Module
Back Cover Cover Page Page 1-Triple click in this textbox and enter your information for Page 1 of your book. Page2-Triple click in this textbox and enter.
CS 3870/CS 5870 Test 2 (50 points) Thursday
Part 3 Saving (without the Save button)
Active-X Calendar Control
Dictionary Builder Part 1 Getting Started.
Part 2 Saving the Dictionary
C# Revision Cards Data types
Back Cover Cover Page Page 1-Triple click in this textbox and enter your information for Page 1 of your book. Page2-Triple click in this textbox and enter.
2 Hours Minutes Seconds Insert Text Here.
Final Revision sheet- term2
label1 Name label2 Time (0-23) textBox1 textBox2 textBox3 button1
Presentation transcript:

В проекте рассмотрены функции даты и времени: текущие дата и время, день недели, день месяца, день года, проверка на високосный год, максимальное и минимальное значение в интервале измерения времени, год, день, разность дат. Для каждой функции создается текстовое поле аргумента функции, текстовое результирующее поле, кнопка с названием функции. Управляющие элементы функций, использующих одинаковые исходные поля аргументов окрашены в один цвет.

Программный код Public Class Form1 Dim d1 As DateTime = DateTime.Now Dim d10, d11 As DateTime Dim d2 As Date Dim k As Integer Dim vis As Boolean Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = DateTime.Now End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click d2 = TextBox2.Text k = d2.DayOfWeek Select Case k Case 1 TextBox13.Text = "Понедельник" Case 2 TextBox13.Text = "Вторник" Case 3 TextBox13.Text = "Среда" Case 4 TextBox13.Text = "Четверг" Case 5 TextBox13.Text = "Пятница" Case 6 TextBox13.Text = "Суббота" Case 7 TextBox13.Text = "Воскресенье" End Select End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click d2 = TextBox2.Text TextBox14.Text = d2.Year End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox15.Text = Now() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click d2 = TextBox2.Text TextBox14.Text = d2.Year End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox15.Text = Now() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click d2 = TextBox2.Text TextBox14.Text = d2.Year End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox15.Text = Now() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click d2 = TextBox2.Text TextBox16.Text = Str(d2.Day) End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click d2 = TextBox2.Text TextBox17.Text = d2.DayOfYear End Sub Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click TextBox22.Text = DateTime.MinValue End Sub

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click TextBox21.Text = DateTime.MaxValue End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click TextBox18.Text = Today() End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click d2 = TextBox8.Text k = d2.Year vis = DateTime.IsLeapYear(k) If vis = True Then TextBox20.Text = "Високосный" Else TextBox20.Text = "Невисокосный" End If End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click Dim diff1 As System.TimeSpan d10 = TextBox10.Text d11 = TextBox11.Text diff1 = System.DateTime.op_Subtraction(d10, d11) TextBox19.Text = Str(diff1.Days) + " дней " + Str(diff1.Hours) + " часов " + Str(diff1.Minutes) + " минут" End Sub End Class