Results 1 to 19 of 19

Thread: Question on changing color of form

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Question on changing color of form

    Hey! Using a color dialog, I made it so that the user can change the color of the program background. It changes alright, but some of the controls dont change fully. I have a few pictures below. The first is the original color, then the second is after I change it to blue. Notice what happens in the red squares.

    Picture1:


    Picture2:


    I checked the properties of each box and they appear the same. Any ideas why its acting strange like that? Id like either both of them to be filled the same, or both of them to just be the original color and the entire box FULLY surrounded with the color.. Thanks so MUCH

    John

  2. #2
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Question on changing color of form

    either you are setting those particular frames to the new color OR their backround color is set to Transparent, so that it picks up the form color. Go through them all at design time and change all their backcolor to Transparent and that should make them all get the forms color.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Question on changing color of form

    hey. I'm actually setting the backcolor of the tabpage so I know thats not the problem. All of the group boxes are set to the color "controlLightLight". When I try and change them to transparent, I get an error that says transparent isn't a valid color for them. Any ideas?

  4. #4
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: Question on changing color of form

    Hey,the backcolor by default is "Control"...I wonder why you need transparent then..Just change all their back colors to "Control" I think this would work
    Godwin

    Help someone else with what someone helped you!

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Question on changing color of form

    well... uh my form normall isn't the 'control' color. I think looks too dark. I like it at the controllightlight... whats next?

  6. #6
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: Question on changing color of form

    The form defaulr backcolor is control here..Which version of .net are you using?
    Godwin

    Help someone else with what someone helped you!

  7. #7
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Question on changing color of form

    You need to change the backcolor of all your frames to change backcolor at the same time as your form, since they do not accept transparent.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Question on changing color of form

    ok.. well i dont want the frames to be the same color.. i want just the background of the page to change.. and thats what I did in my code. But for some reason some of them end up changing and some of the fonts background change and its really erratic!

    John

  9. #9
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Question on changing color of form

    Quote Originally Posted by JohnRChick
    ok.. well i dont want the frames to be the same color.. i want just the background of the page to change.. and thats what I did in my code. But for some reason some of them end up changing and some of the fonts background change and its really erratic!

    John
    ok, are you setting your frames backcolor at runtime or design time? what i suspect at the moment is perhaps changing the color object to set the form with which is used also to set the frames.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Question on changing color of form

    i have the forms all set to 'controllighlight' at design time. What do you mean by what you said?

  11. #11
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Question on changing color of form

    Quote Originally Posted by JohnRChick
    i have the forms all set to 'controllighlight' at design time. What do you mean by what you said?
    it doesnt matter, as you are setting it at design time. That also means that perhaps you should double check those three group boxes and make sure they are not set the transparent, as i cannot think of any other causes at this point in time.

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Question on changing color of form

    hmm ok.. I checked them and they;re not set to transparent.. It appears as though any NEW group boxes that I add will automatically take the background color (even if they're set to lightlight).. This is so weird.. Anyone have a suggestion?

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Question on changing color of form

    I JUST NOTICED SOMETHING! When I click on some of the group boxes, the words 'ControlLightLight' are bold.. and on some of them its not. The ones that are bold dont change their background color, and the ones that aren't DO change the background color.

    John

  14. #14
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Question on changing color of form

    Quote Originally Posted by JohnRChick
    I JUST NOTICED SOMETHING! When I click on some of the group boxes, the words 'ControlLightLight' are bold.. and on some of them its not. The ones that are bold dont change their background color, and the ones that aren't DO change the background color.

    John
    That's weird, i have never come accross that.. are you using .net 2005 ?

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Question on changing color of form

    nope! I have vb.net 2004

  16. #16
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: Question on changing color of form

    When a property is bold it means that it's not the default. Some controls like the groupbox or the label adopt the form's backcolor only if you haven't altered the control's backcolor property.

    A simple way to get the defaults back is to go to your windows forms designer generated code and delete all the lines that assign colors to the backcolor property of the controls.
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Question on changing color of form

    so would this explain why some of them are changing, and some aren't? I can get the misbehaving ones to change if i manually assign them the color once the user selects it.

  18. #18
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: Question on changing color of form

    Quote Originally Posted by JohnRChick
    so would this explain why some of them are changing, and some aren't? I can get the misbehaving ones to change if i manually assign them the color once the user selects it.
    In that case just do it for all off them, it's neater and you can use a loop.
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Question on changing color of form

    It Works. I Went Through The Designer Code And Fixed Them! Thanks So Much!!

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