19
Word Processor Version .01 EME 4411 Week 5

Word Processor Version .01

Embed Size (px)

DESCRIPTION

Word Processor Version .01. EME 4411 Week 5. The Scroll Bars. Important Properties. max and min - range of integers the horizontal scroll bar can represent No caption property - use a label value property specifies the current value of the scroll bar. - PowerPoint PPT Presentation

Citation preview

Page 1: Word Processor Version .01

Word Processor Version .01

EME 4411Week 5

Page 2: Word Processor Version .01

The Scroll Bars

Page 3: Word Processor Version .01

Important Properties max and min - range of integers

the horizontal scroll bar can represent

No caption property - use a label value property specifies the current

value of the scroll bar. smallchange - click on an arrow Largechange - click a open area

between the handle and the arrow

Page 4: Word Processor Version .01

Example

Write a program that allows the user to input a number between 1 and 100

We will use a horizontal scroll bar to ensure that the user ONLY adds a legal integer

Page 5: Word Processor Version .01

Design the Interface

Page 6: Word Processor Version .01

•Set the Properties

Scroll Bar  Name = hsbScroll1Value = 50smallchange = 1largechange = 5

Label Name = lblValueCaption = "50"Alignment = Center

Page 7: Word Processor Version .01

Write the Code

Private Sub hsbScrollBar1_Change()

lblValue.Caption = hsbScrollBar1.Value

End Sub

Page 8: Word Processor Version .01

Word Processor .1

Write a simple word processor that allows the user to set the font name with radio buttons, font style with check boxes, and font size with a horizontal scroll bar.

Page 9: Word Processor Version .01

Design the Form

Page 10: Word Processor Version .01

Properties

Form frmWord BackColor = Make it blue Caption = "Word Processor .01"

Command Button

cmdClear Caption = "&Clear"

Command Button

cmdExit Caption = "E&xit"

Text Box txtFontSize Alignment = Center

Page 11: Word Processor Version .01

Properties (continued)Scroll Bar HSBFontSize LargeChange = 4

Max = 22Min = 6SmallChange = 4Value = 14

Check Box chkItalics BackColor = Make it blueCaption= “&Italics”

Check Box chkUnderline BackColor = Make it blueCaption = “&Underline”

Check Box chkBold BackColor = Make it blueCaption = "&Bold"

Page 12: Word Processor Version .01

Properties (Continued)Option Button optSchoolbook BackColor = Make it blue

Caption = "Schoolbook"FontName = "Century Schoolbook"FontSize = 8.25

Option Button optArial BackColor = Make it blueCaption = "Arial"FontName = "Arial"FontSize = 8.25

Option Button optSansSerif BackColor = Make it blueCaption = "Sans Serif"

Page 13: Word Processor Version .01

Properties (Continued)Text Box txtText FontBold = False

MultiLine = TrueScrollBars = Vertical

Label Label3 Alignment = CenterBackColor= Make it blueCaption = "Font Size:"

Label lblFontType BackColor = Make it blueCaption = "Font Type:"

Label lblFont BackColor = Make it blueCaption = "Select Font:"

Page 14: Word Processor Version .01

Write the CodechkBold

If chkBold is false Then

set Font bold in text widow to False

Else

set Font bold in text widow to True

Page 15: Word Processor Version .01

Write the CodechkUnderline

If underline value is False Then

set Font underline to False

Else

set Font underline to False

Page 16: Word Processor Version .01

Write the CodeoptArial

If its value is True Then txtText.FontName = "Arial"

Page 17: Word Processor Version .01

Write the CodehsbFontSize

set text size caption to HSB’s Font size

set text.window font size to HSB Font size

Page 18: Word Processor Version .01

Homework

Write Word Processor .1

Have a great week!

Page 19: Word Processor Version .01

Write the CodechkItalics

If chkItalics is false

set Font Italic in text window to False

Else

set Font Italic in text window to True