Hey all,
I have been searching and reading endlessly trying to find something similar, but can't seem to find it. I have a application I designed to interface with After Effects. It is for title graphics (video) at events where we have various speakers and titles and locations where they are from. The problem stems from the fact that the name, title, and location may need to be in different places on the screen at a given time.
So, I used a simple form which has drop downs (comboboxes) for the selection of the name, title, and location. There is more, but I am keeping the description to this as to not muddy things more than they need to be. Under each combo, there are 3 check boxes. Each checkbox designates a location on the screen... (Upper, Lower, and Misc)
If the user selects bob smith (from the combo) and selects the "Upper" checkbox I programmaticly alter the other "upper" checkboxes to be a different color, disabled, and locked. This is to keep the user from possibly trying to put two pieces of information into the same section of the screen.
The same works for Lower and Misc.
This all works rather well minus a couple of logistical things I need to work out. The problem (and this happens with most creative types) is that as I modify the look, or layout, or add extra features, I have to modify a brazillion nuggets of code as there is a function for each checkbox. I would like to put the specific checkboxes into an array so that only the items in that particular array are effected when they click on a checkbox. It could loop through these particular checkboxes and only change their settings, not all the checkboxes in the whole form (which there is loads of source code for). I have tried this a number of ways, but can not seem to make it work.
Here is a simplified bit of the current working code...
Here is what I am trying to do...
Any thoughts?
I have been searching and reading endlessly trying to find something similar, but can't seem to find it. I have a application I designed to interface with After Effects. It is for title graphics (video) at events where we have various speakers and titles and locations where they are from. The problem stems from the fact that the name, title, and location may need to be in different places on the screen at a given time.
So, I used a simple form which has drop downs (comboboxes) for the selection of the name, title, and location. There is more, but I am keeping the description to this as to not muddy things more than they need to be. Under each combo, there are 3 check boxes. Each checkbox designates a location on the screen... (Upper, Lower, and Misc)
If the user selects bob smith (from the combo) and selects the "Upper" checkbox I programmaticly alter the other "upper" checkboxes to be a different color, disabled, and locked. This is to keep the user from possibly trying to put two pieces of information into the same section of the screen.
The same works for Lower and Misc.
This all works rather well minus a couple of logistical things I need to work out. The problem (and this happens with most creative types) is that as I modify the look, or layout, or add extra features, I have to modify a brazillion nuggets of code as there is a function for each checkbox. I would like to put the specific checkboxes into an array so that only the items in that particular array are effected when they click on a checkbox. It could loop through these particular checkboxes and only change their settings, not all the checkboxes in the whole form (which there is loads of source code for). I have tried this a number of ways, but can not seem to make it work.
Here is a simplified bit of the current working code...
Code:
Private Sub Sec_Upper_Click()
If Sec_Upper.Value = True Then
Sec_Lower.SpecialEffect = fmButtonEffectFlat
Sec_Lower.ForeColor = &H808080
Sec_Lower.Enabled = False
Sec_Lower.Locked = True
' Sec_Misc.BackStyle = fmBackStyleTransparent
Sec_Misc.SpecialEffect = fmButtonEffectFlat
Sec_Misc.ForeColor = &H808080
Sec_Misc.Enabled = False
Sec_Misc.Locked = True
' Misc_Upper.BackStyle = fmBackStyleTransparent
Misc_Upper.SpecialEffect = fmButtonEffectFlat
Misc_Upper.ForeColor = &H808080
Misc_Upper.Enabled = False
Misc_Upper.Locked = True
' Cust_Upper.BackStyle = fmBackStyleTransparent
Cust_Upper.SpecialEffect = fmButtonEffectFlat
Cust_Upper.ForeColor = &H808080
Cust_Upper.Enabled = False
Cust_Upper.Locked = True
' Atl_Upper.BackStyle = fmBackStyleTransparent
Atl_Upper.SpecialEffect = fmButtonEffectFlat
Atl_Upper.ForeColor = &H808080
Atl_Upper.Enabled = False
Atl_Upper.Locked = True
' PIP_Upper.BackStyle = fmBackStyleTransparent
PIP_Upper.SpecialEffect = fmButtonEffectFlat
PIP_Upper.ForeColor = &H808080
PIP_Upper.Enabled = False
PIP_Upper.Locked = True
ElseIf Sec_Upper.Value = False Then
' Sec_Upper.BackStyle = fmBackStyleOpaque
Sec_Upper.SpecialEffect = fmButtonEffectSunken
Sec_Upper.ForeColor = &HFFFFFF
Sec_Upper.Enabled = True
Sec_Upper.Locked = False
' Sec_Lower.BackStyle = fmBackStyleOpaque
Sec_Lower.SpecialEffect = fmButtonEffectSunken
Sec_Lower.ForeColor = &HFFFFFF
Sec_Lower.Enabled = True
Sec_Lower.Locked = False
' Sec_Misc.BackStyle = fmBackStyleOpaque
Sec_Misc.SpecialEffect = fmButtonEffectSunken
Sec_Misc.ForeColor = &HFFFFFF
Sec_Misc.Enabled = True
Sec_Misc.Locked = False
' Misc_Upper.BackStyle = fmBackStyleOpaque
Misc_Upper.SpecialEffect = fmButtonEffectSunken
Misc_Upper.ForeColor = &HFFFFFF
Misc_Upper.Enabled = True
Misc_Upper.Locked = False
' Cust_Upper.BackStyle = fmBackStyleOpaque
Cust_Upper.SpecialEffect = fmButtonEffectSunken
Cust_Upper.ForeColor = &HFFFFFF
Cust_Upper.Enabled = True
Cust_Upper.Locked = False
' Atl_Upper.BackStyle = fmBackStyleOpaque
Atl_Upper.SpecialEffect = fmButtonEffectSunken
Atl_Upper.ForeColor = &HFFFFFF
Atl_Upper.Enabled = True
Atl_Upper.Locked = False
' PIP_Upper.BackStyle = fmBackStyleOpaque
PIP_Upper.SpecialEffect = fmButtonEffectSunken
PIP_Upper.ForeColor = &HFFFFFF
PIP_Upper.Enabled = True
PIP_Upper.Locked = False
End If
End Sub
Here is what I am trying to do...
Code:
Private Sub Sec_Upper_Click()
Dim chBoxArray(6) As CheckBox
Set chBoxArray(0) = Sec_Upper
Set chBoxArray(1) = Sec_Lower
Set chBoxArray(2) = Sec_Misc
Set chBoxArray(3) = Misc_Upper
Set chBoxArray(4) = Cust_Upper
Set chBoxArray(5) = Atl_Upper
Set chBoxArray(6) = PIP_Upper
If Sec_Upper.Value = True Then
Dim x As Integer
For x = 1 To 6
chBoxArray(x).BackStyle = fmBackStyleTransparent
chBoxArray(x).SpecialEffect = fmButtonEffectFlat
chBoxArray(x).ForeColor = &H808080
chBoxArray(x).Enabled = False
chBoxArray(x).Locked = True
Next x
ElseIf Sec_Upper.Value = False Then
Dim y As Integer
For y = 0 To 6
chBoxArray(y).BackStyle = fmBackStyleOpaque
chBoxArray(y).SpecialEffect = fmButtonEffectSunken
chBoxArray(y).ForeColor = &HFFFFFF
chBoxArray(y).Enabled = True
chBoxArray(y).Locked = False
Next y
End If
End Sub
Any thoughts?