Changing Form Color on Load

ryodoan

Well-known member
Joined
Jul 16, 2004
Messages
65
Location
Ohio
Programming Experience
3-5
When the program is starting up, I want it to change the form backcolor. The only way I know how to do it when the program is running is with this:



frmMemberList.ActiveForm.BackColor = clrBackColor

but when the program is loading, and the form is not "active" yet, it crashes at that point...

Any suggestions to on how to change the backcolor on the form, as soon as it loads?
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
If the code is placed in the form that you want to change the backColor of, you can use Me.BackColor = clrBackColor.

The 'ActiveForm' property is the active form for the application. The 'Me' keyword refers to the form in which the code resides.
 

ryodoan

Well-known member
Joined
Jul 16, 2004
Messages
65
Location
Ohio
Programming Experience
3-5
sorry for the delay in reply, for some reason my email notification didnt come through... I just checked the forum before going to bed (its 2:28 am here...) so I will try this tommorow, hopefully it works.

<Edit> I just tested it, and it works perfectly now, thanks a million
 
Last edited:
Top Bottom