Results 1 to 8 of 8

Thread: background color

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Westfield, IN, USA
    Posts
    59
    i have a specific color, in the RGB or hex code that i want to use. How do i specify this color for the background of one of my forms. I want it to be exactly this color...

    Also, how do i open a new form?
    i thought it was "Show Form2" but i guess it's not...

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    Form Code:
    Code:
    Private Sub Form_Load()
    
        Me.BackColor = &H8000000F
        'you can also set this in form properties
    End Sub
    If you have added a new form (Form2):
    Code:
    Load Form2
    Form2.Show

  3. #3
    Hyperactive Member Matt-D's Avatar
    Join Date
    Nov 1999
    Location
    Mettmann, Germany
    Posts
    305
    You can do this
    Code:
    Private Sub Form1_Load()
        Form2.BackColor = Form1.BackColor
    End Sub
    [i]
    Good luck, Matt-D(eutschland)

  4. #4
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Worldwide in the Sun
    Posts
    566
    Try This


    ' color setting
    form1.backcolor = RGB(128,0,0) 'set backcolor red
    ' load and opens form
    form1.show


    ' explanation of RGB(128,0,0)
    RGB(Red as Integer, Green as Integer, Blue as Integer) as Long


    Cheers
    Ray
    Ray

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Westfield, IN, USA
    Posts
    59
    how do i convert my rgb code to the one that looks like &H8000000F ?

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    ?"&H" & Hex(((blue * &H100) + green) * &H100 + red)
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Westfield, IN, USA
    Posts
    59
    i must really be out of it... i don't get that code... i understand it, but i can't get it to work...

    can someone tell me what the vb code for the color #003366 or RGB: red=0, green=51, blue=102

    this is the color i need, but i can't seem to get any of it to work...

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Whats the problem? I mean that hex code you gave is red:102 and blue:0, how did you get those values?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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