Upload
judith-lynn
View
20
Download
1
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
Word Processor Version .01
EME 4411Week 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. smallchange - click on an arrow Largechange - click a open area
between the handle and the arrow
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
Design the Interface
•Set the Properties
Scroll Bar Name = hsbScroll1Value = 50smallchange = 1largechange = 5
Label Name = lblValueCaption = "50"Alignment = Center
Write the Code
Private Sub hsbScrollBar1_Change()
lblValue.Caption = hsbScrollBar1.Value
End Sub
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.
Design the Form
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
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"
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"
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:"
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
Write the CodechkUnderline
If underline value is False Then
set Font underline to False
Else
set Font underline to False
Write the CodeoptArial
If its value is True Then txtText.FontName = "Arial"
Write the CodehsbFontSize
set text size caption to HSB’s Font size
set text.window font size to HSB Font size
Homework
Write Word Processor .1
Have a great week!
Write the CodechkItalics
If chkItalics is false
set Font Italic in text window to False
Else
set Font Italic in text window to True