none
Background Color RRS feed

  • Question

  • I have set the background color of my main form to InactiveCaptionText which looks fine to me but if the user doesn't like it I wish to offer the option to change the colour back to the default form BackColor called Control.

    The code is simple but there is no option to choose Control (or InactiveCaptionText for that matter) and I cannot find a color that is even close to Control. Beige or OldLace are too light.

    Any suggestions as to how I can do this? I'm using VB

     

    Thursday, July 15, 2010 12:48 AM

Answers

  • Hi Dave,

    To set the BackColor of the form back to color "Control", set the backcolor to SystemColors.Control, here is the code :

          this.BackColor = SystemColors.Control;

    Sincerely,
    Helen Zhou

     

     

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Dave C_1 Thursday, July 15, 2010 2:56 AM
    Thursday, July 15, 2010 2:17 AM

All replies

  • I'll come back and check this later but in the mean time I have decided to go with the following:

    GroupBox1.BackColor = Color.LightGray

    BtnShow.BackColor = Color.Gainsboro

    BtnShow.ForeColor = Color.Black

    These are not the same as the colours available in the properties list but hey, what can you do?

    D.

     

    Thursday, July 15, 2010 1:45 AM
  • Hi Dave,

    To set the BackColor of the form back to color "Control", set the backcolor to SystemColors.Control, here is the code :

          this.BackColor = SystemColors.Control;

    Sincerely,
    Helen Zhou

     

     

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Dave C_1 Thursday, July 15, 2010 2:56 AM
    Thursday, July 15, 2010 2:17 AM
  • Works like a charm, Helen.

    Thank you very much.

    Regards,

    David

    Thursday, July 15, 2010 2:54 AM