Results 1 to 11 of 11

Thread: ColorDialog1 not working with MenuStrip execute

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2016
    Posts
    125

    ColorDialog1 not working with MenuStrip execute

    I am teaching myself VS from "Programming in Visual Basic 2010" by Julia C. Bradley & Anita C. Millspaugh. The textbook has a sample project that I coded to match the text. In the form MenuStrip execute, FontDialog1 and ColorDialog1 are used on the TextBoxes inside a GroupBox. When the color code is performed no color change occurs when executed. The Font change works as expected. I have successfully used the ColorDialog1 code before. I have confirmed the code is executed with a Debug break. Is there something in the properties for the GroupBox or TextBoxes that I have overlooked? TIA JP

    Code:
      Public Sub ColorToolStripMenuItem_Click(ByVal sender As System.Object,
                                    ByVal e As System.EventArgs) Handles ColorToolStripMenuItem.Click
    
            With ColorDialog1
                ' Change the color of the total labels.
                .Color = SubTotalTextBox.ForeColor
                .ShowDialog()
                SubTotalTextBox.ForeColor = .Color
                TaxTextBox.ForeColor = .Color
                TotalTextBox.ForeColor = .Color
            End With
    
        End Sub
    Last edited by dday9; Feb 10th, 2017 at 10:14 AM. Reason: Added Code Tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width