Code:If frmMain.imgHead.Visible = False Then
If frmMain.imgArm.Visible = False Then
If frmMain.imgArms.Visible = False Then
If frmMain.imgLeg.Visible = False Then
If frmMain.imgFeet.Visible = False Then
frmMain.imgHead.Visible = True
Else
Printable View
Code:If frmMain.imgHead.Visible = False Then
If frmMain.imgArm.Visible = False Then
If frmMain.imgArms.Visible = False Then
If frmMain.imgLeg.Visible = False Then
If frmMain.imgFeet.Visible = False Then
frmMain.imgHead.Visible = True
Else
are you trying to do a hangman game?
i can't really help cause i usually write unneccessary lines myself.
yea acctually I am (its kinda obvious)
Use the AND operator in your if statement...
Its a long line but it reduces it.Code:
With frmMain
If Not(.imgHead.Visible and .imgHead.Visible and .imgArm.Visible and .imgArms.Visible and .imgLeg.Visible and .imgFeet.Visible) Then
.imgHead.Visible = True
End If
End with
THANKS
Illuminator, I don't think that's right.
the original code was
Code:If frmMain.imgHead.Visible = False Then
If frmMain.imgArm.Visible = False Then
If frmMain.imgArms.Visible = False Then
If frmMain.imgLeg.Visible = False Then
If frmMain.imgFeet.Visible = False Then
frmMain.imgHead.Visible = True
which says to make the head visible if and only if none of the listed images are visible.
Your code will make the head visible if any of them are invisible. Use this instead.
Code:With frmMain
If Not(.imgHead.Visible Or .imgHead.Visible Or .imgArm.Visible Or .imgArms.Visible Or .imgLeg.Visible Or .imgFeet.Visible) Then
.imgHead.Visible = True
End If
End with
NB I've just copied your code and replaced the Ands with Ors, I hope there isn't a copyrite infringement :)
no.... I need it so that if none of them are visible then the head is visible, not if any of them are visible
I have an idea:
Public NumWrong as Integer
then if they guess wrong:
NumWrong = NumWrong + 1
Call DoHangMan(NumWrong)
and for the function:
Public Function DoHangMan(Num1 as Integer)
Select Case Num1
Case 1
LeftLeg.visible = true
Case 2
Rightleg.visible = true
case 3
Leftboob.visible = true
case 4
vagina.visible = true
case 5
pornvideo.start
End select
End Function
I hope you get the point, No not that I'm addicted to porn!!!
Ugh... that you should do that ^looks up^
If they win do this:
numwrong = 0
if msgbox("Are you sure you want to banish the porn?",vbyesno,"Porn banishing comFIRMation") = vbyes then
'make all the stuff invisible
Else
'let the user jack off to porn
End If
Sounds good to me!
(I need a spellchecker)
That's what my code does. The head will only appear if none of the body parts are visible.
in that case, thanks
Whoops! I was thinkng
...and not(body_part) and not(other_ body_part)...
I for got the and or relations:
and not()...and not()...and not()
equals
not (or...or...or)
A slight modification:
with frmMain
.imgHead.visible = Not(.imgArm.visible Or .imgArms.Visible Or .imgLeg.Visible Or .imgFeet.Visible)
End With
Try using an ARRAY for your image controls that way you can put them into a loop. Like this:
______________________________
Dim I As Integer
For I = 0 to 10
frmMain.(I).Visible = False
Next I
_________________________
Or how about this for example:
____________________________________
For Each Control in frmMain.Controls
Control.Visible = False
Next Control
_____________________________________
Or this:
_______________________-
For Each Control in frmMain.Controls
If Not TypeOf Control Is CommandButton Then
Control.Visible = False
End If
Next Control
_________________________________
Just a couple of ideas. I didn't test any of this logic and I hope i didn't steer you in the wrong direction.