190 likes | 301 Views
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.
E N D
Word Processor Version .01 EME 4411Week 5
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
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.
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
Scroll Bar HSBFontSize LargeChange = 4Max = 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 blueCaption = "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:" Properties (Continued)
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 toFalse 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