csc115 introduction to computer programming zhen jiang dept. of computer science west chester...

9
CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 [email protected]

Upload: cecil-bradley

Post on 13-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 zjiang@wcupa.edu

CSC115 Introduction to Computer Programming

Zhen Jiang

Dept. of Computer Science

West Chester University

West Chester, PA 19383

[email protected]

Page 2: CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 zjiang@wcupa.edu

Table of Contents Introducation

VB Three steps to develop VB program Feature objects – controls (step 1)

Text box, command button, label, picture box, etc Property setting (step 2) Event description (step 3)

Page 3: CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 zjiang@wcupa.edu

VB Pages 19-21 VB programs display a windows screen (called form)

and its control objects (four of them will be introduced later)

Three steps to create VB program Create the interface; generate position and size of

window control objects (in the form) Set Properties Write the code in code window that will execute when

the events occur.

Page 4: CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 zjiang@wcupa.edu
Page 5: CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 zjiang@wcupa.edu

Text box, p22 Name, Backcolor, Borderstyle, Enabled, Font, Forecolor,

Multiline, Readonly, Text, TextAlign, Visible, ReadOnly

Command button, p26 Name, Backcolor, BackgroundImage, Enabled, Font, ForeColor,

Image, ImageAlign, Text, TextAlign, Visible

Label, p28 Name, AutoSize, BackColor, BackStyle, BoderStyle, Enabled,

Font, ForeColor, Text, TextAlign, Visible

Picture box Name, BackgroundImage, BoderStyle, Image, sizeMode, Visible

List Box, p28 Items

Page 6: CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 zjiang@wcupa.edu

Name (lbl, txt, btn, pic, lst), Table 1, page 29 Fonts, for instance, Windings & J-K-L, etc Advanced property setting, for instance,

Color.Red, page 41

Page 7: CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 zjiang@wcupa.edu

Auto hide of tool box Access key Exit button, me.close() Message box List box

Page 8: CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 zjiang@wcupa.edu

Advanced button functions Copy Clearing Focus and tab order, page 32 Accept button (enter)

Form1.AcceptButton = btn1 Cancel button (Esc)

Form1.CancelButton = btn2

Page 9: CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383 zjiang@wcupa.edu

Summary of programming(3-3-3)

3 steps, page 36 For the coding step, 3 sub-steps, page 37

Know what is the action, in your own word Know how to initiate it (how and where to start

the computer’s action) Translation to VB by 3 factors in the right format

Target object Property New setting