Presentation is loading. Please wait.

Presentation is loading. Please wait.

Word Processor Version.01 EME 4411 Week 5. The Scroll Bars.

Similar presentations


Presentation on theme: "Word Processor Version.01 EME 4411 Week 5. The Scroll Bars."— Presentation transcript:

1 Word Processor Version.01 EME 4411 Week 5

2 The Scroll Bars

3 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

4 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

5 Design the Interface

6 Set the Properties Scroll Bar Name = hsbScroll1 Value = 50 smallchange = 1 largechange = 5 LabelName = lblValue Caption = "50" Alignment = Center

7 Write the Code Private Sub hsbScrollBar1_Change() lblValue.Caption = hsbScrollBar1.Value End Sub

8 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.

9 Design the Form

10 Properties FormfrmWordBackColor = Make it blue Caption = "Word Processor.01" Command Button cmdClearCaption = "&Clear" Command Button cmdExitCaption = "E&xit" Text BoxtxtFontSizeAlignment = Center

11 Properties (continued) Scroll BarHSBFontSizeLargeChange = 4 Max = 22 Min = 6 SmallChange = 4 Value = 14 Check BoxchkItalicsBackColor = Make it blue Caption= “&Italics” Check BoxchkUnderlineBackColor = Make it blue Caption = “&Underline” Check BoxchkBoldBackColor = Make it blue Caption = "&Bold"

12 Properties (Continued) Option ButtonoptSchoolbookBackColor = Make it blue Caption = "Schoolbook" FontName = "Century Schoolbook" FontSize = 8.25 Option ButtonoptArialBackColor = Make it blue Caption = "Arial" FontName = "Arial" FontSize = 8.25 Option ButtonoptSansSerifBackColor = Make it blue Caption = "Sans Serif"

13 Properties (Continued) Text BoxtxtTextFontBold = False MultiLine = True ScrollBars = Vertical LabelLabel3Alignment = Center BackColor= Make it blue Caption = "Font Size:" LabellblFontTypeBackColor = Make it blue Caption = "Font Type:" LabellblFontBackColor = Make it blue Caption = "Select Font:"

14 Write the Code chkBold If chkBold is false Then set Font bold in text widow to False Else set Font bold in text widow to True

15 Write the Code chkUnderline If underline value is False Then set Font underline to False Else set Font underline to False

16 Write the Code optArial If its value is True Then txtText.FontName = "Arial"

17 Write the Code hsbFontSize set text size caption to HSB’s Font size set text.window font size to HSB Font size

18 Homework Write Word Processor.1 Have a great week!

19 Write the Code chkItalics If chkItalics is false set Font Italic in text window to False Else set Font Italic in text window to True


Download ppt "Word Processor Version.01 EME 4411 Week 5. The Scroll Bars."

Similar presentations


Ads by Google