What is the code to change the background color in a user form to white?
Printable View
What is the code to change the background color in a user form to white?
Simply set the form's backcolor property to white.
form1.backcolor = &H8000000E8&
It's much easier to use the constants.
Code:Form1.BackColor = vbWhite
Thanks Guys!!!!
Oh yeah. How do I change it back to the default color?
Code:Form1.BAckColor=vb3DFace
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:
What is wrong?Code:Sub Print()
frmReferral.BackColor = vbWhite
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.Code:Sub Print()
frmReferral.BackColor = vbWhite
Doevents
frmReferral.PrintForm
frmReferral.BackColor = vb3DFace
End Sub
For some reason that didn't work. What is wrong?
Thank you for your helpCode: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
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?