Is it possible???

ayoung
09-07-2003, 10:33 PM
What it does is fills in spots as the uses need 1, 2, 3, or all 4 frames.

Can this be simplified any? LOL Have fun!!

If Check1.Value = 1 Then
frmMain.frmBF.Visible = True
frmMain.frmBF.Left = 360
frmMain.frmBF.Top = 360
frmMain.frmL.Left = 2760
frmMain.frmL.Top = 360
Else
End If



If Check2.Value = 1 Then
frmMain.frmL.Visible = True
If Check1.Value = 1 Then GoTo skip
frmMain.frmL.Left = 360
frmMain.frmL.Top = 360
skip:
Else
frmMain.frmL.Left = 2760
frmMain.frmL.Top = 360

End If



If Check3.Value = 1 Then
frmMain.frmD.Visible = True
If Check1.Value = 0 And Check2.Value = 0 Then
frmMain.frmD.Left = 360
frmMain.frmD.Top = 360
Else
If Check1.Value = 1 And Check2.Value = 0 Or Check1.Value = 0 And Check2.Value = 1 Then
frmMain.frmD.Left = 2760
frmMain.frmD.Top = 360
Else
frmMain.frmD.Left = 360
frmMain.frmD.Top = 2160
End If
End If
End If


If Check4.Value = 1 Then
frmMain.frmBT.Visible = True
If Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 0 Then
frmMain.frmBT.Left = 360
frmMain.frmBT.Top = 360
Else
If Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 0 Or Check1.Value = 0 And Check2.Value = 1 And Check3.Value = 0 Or Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 1 Then
frmMain.frmBT.Left = 2760
frmMain.frmBT.Top = 360
Else
If Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 1 Or Check1.Value = 1 And Check2.Value = 1 And Check3.Value = 0 Or Check1.Value = 0 And Check2.Value = 1 And Check3.Value = 1 Then
frmMain.frmBT.Left = 360
frmMain.frmBT.Top = 2160
Else
frmMain.frmBT.Left = 2760
frmMain.frmBT.Top = 2160

End If
End If
End If
End If

If Check1.Value = 0 Then frmMain.frmBF.Visible = False
If Check2.Value = 0 Then frmMain.frmL.Visible = False
If Check3.Value = 0 Then frmMain.frmD.Visible = False
If Check4.Value = 0 Then frmMain.frmBT.Visible = False

gundavarapu
09-08-2003, 04:00 AM
May not be of great help, but a more structured approach for the above problem...


Sub foo()

Dim Loc1 As Boolean, Loc2 As Boolean, Loc3 As Boolean, Loc4 As Boolean

If Check1.Value = 1 Then
Location1 frmBF
Loc1 = True
Else
frmBF.Visible = False
End If

If Check2.Value = 1 Then
If Loc1 Then
Location2 frmL
Loc2 = True
Else
Location1 frmL
Loc1 = True
End If
Else: frmL.Visible = False
End If

If Check3.Value = 1 Then
If Loc2 Then
Location3 frmD
Loc3 = True
ElseIf Loc1 Then
Location2 frmD
Loc2 = True
Else
Location1 frmD
Loc1 = True
End If
Else: frmD.Visible = False
End If

If Check4.Value = 1 Then
If Loc3 Then
Location4 frmBT
ElseIf Loc2 Then
Location3 frmBT
ElseIf Loc1 Then
Location2 frmBT
Else:
Location1 frmBT
End If
Else: frmBT.Visible = False
End If

End Sub

Sub Location1(ByRef obj As Frame)
obj.Visible = True
obj.Left = 360
obj.Top = 360
End Sub

Sub Location2(ByRef obj As Frame)
obj.Visible = True
obj.Left = 2760
obj.Top = 360
End Sub

Sub Location3(ByRef obj As Frame)
obj.Visible = True
obj.Left = 360
obj.Top = 2160
End Sub

Sub Location4(ByRef obj As Frame)
obj.Visible = True
obj.Left = 2760
obj.Top = 2160
End Sub


May be you like the sub's to be generalized like this

Sub AllLocations(ByRef obj As Frame, byval Left as integer, byval Top as integer)
obj.Visible = True
obj.Left = Left
obj.Top = Top
End Sub
'usage AllLocations frmBF, 360, 360

Hope this helps!

ayoung
09-08-2003, 09:31 PM
Wow, it looks like you really put some time into this, thanks alot man!

Lemme look it over.

:) Adam

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum