![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Posts: 25
Rep Power: 0
![]() |
The title may seem simple but has been very frustrating.T his is what i need to do.:
As My Startup Object i have a form that has 4 different colour pictures. When the user clicks these i would like that to be the backcolour of all forms to be displayed. I have used this code: Private Sub Image4_Click frmWelcome.BackColor = vbBlue Label1.BackColor = vbBlue Label1.ForeColor = vbBlack call ColourBlue End Sub I have put the procedure ColoyrBlue in a module: frm1.backcolor = vbblue frm2.backcolor = vbblue frm3.baccolor = vbblue But when this code is put in place it changes the colour of one form but no others also when i go back on a form the colour stays the standard colour. Hope you can help |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Mar 2005
Posts: 11
Rep Power: 0
![]() |
Declare a global variable that will hold the current selected colour and assign that colour to the backcolor property of each form load.
eg. In the module do this Dim varBColor as variant
sub main()
varBColor=#000ff0 ' Set this to the default color
end subon image click do this varBColor=vbBlue ' Or whatever color u want on each form load do this private Sub Form_Load()
form1.BackColor=varBColor
end subYou can always ask Rory !!!! He's the God of VB ![]() |
|
|
|
|
|
#3 | |
|
Expert Programmer
|
Quote:
Anyway what you said's good, just:varBColor=&H000ff0 ' Set this to the default color Public varBColor as Long |
|
|
|
|
|
|
#4 |
|
Newbie
Join Date: Mar 2005
Posts: 25
Rep Power: 0
![]() |
Thanks To Everyone that helped.
You are all great |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|