Results 1 to 10 of 10

Thread: Change Background Color?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263

    Question

    What is the code to change the background color in a user form to white?
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  2. #2
    Hyperactive Member barrk's Avatar
    Join Date
    Sep 2000
    Location
    My own little world
    Posts
    274

    Smile Easy!

    Simply set the form's backcolor property to white.

    form1.backcolor = &H8000000E8&

  3. #3
    Guest
    It's much easier to use the constants.
    Code:
    Form1.BackColor = vbWhite

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    Thanks Guys!!!!
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    Oh yeah. How do I change it back to the default color?
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    Form1.BAckColor=vb3DFace
    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
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    I am trying that code and it is not working. I have a multi page form too. It has two pages. The reason I need to turn it white is so that it will print white so that it can be faxed. Here is my code:
    Code:
    Sub Print()
    frmReferral.BackColor = vbWhite
    frmReferral.PrintForm
    frmReferral.BackColor = vb3DFace
    End Sub
    What is wrong?
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    Sub Print()
       frmReferral.BackColor = vbWhite
       Doevents
       frmReferral.PrintForm
       frmReferral.BackColor = vb3DFace
    End Sub
    The form won't paint unless you give it a chance In fact it first prints, then paint it white and immediately paints it back. Doevents will allow your form to repaint.
    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.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    For some reason that didn't work. What is wrong?
    Code:
    Sub Print1()
    frmReferral.BackColor = vbWhite
    DoEvents
    frmReferral.PrintForm
    frmReferral.BackColor = vb3DFace
    MsgBox "Please pick up your referral off of the printer and save it for your personal records."
    End Sub
    Thank you for your help
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    This may be the problem. I have MultiPage. I have two tabs that I am using over the form. How would I identify those to change them white?
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

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