I’m working through the very helpful Introduction To Programming text book 2014 edition. I find that one portion of code isn’t working for me, found on page 237:
Dim i, fontListCount As Integer ColorButton.FillColor = Me.SelTextColor BoldButton.Value = Me.SelBold ItalicButton.Value = Me.SelItalic UnderlineButton.Value = Me.SelUnderline FontSizeField.Text = Str(Me.SelTextSize) fontListCount = FontMenu.ListCount - 1 For i = 0 To fontListCount If Me.SelTextFont = FontMenu.List(i) Then FontMenu.ListIndex = i Exit End If Next
The part that fails to perform properly involves the FontMenu object, which starts on line 7. FontMenu is a Popup Menu that lets the user pick a font for selected text in a text area named EditingField. The above code is assigned to the SelChange event for EditingField. After compiling, I find that that moving the cursor around the EditingField contents fails to update the value seen in the fully populated FontMenu object.