|
-
Aug 24th, 2000, 10:57 AM
#1
Thread Starter
Frenzied Member
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
NXSupport - Your one-stop source for computer help
-
Aug 24th, 2000, 11:04 AM
#2
Hyperactive Member
are you trying to do a hangman game?
i can't really help cause i usually write unneccessary lines myself.
-
Aug 24th, 2000, 11:06 AM
#3
Thread Starter
Frenzied Member
yea acctually I am (its kinda obvious)
NXSupport - Your one-stop source for computer help
-
Aug 24th, 2000, 11:14 AM
#4
Lively Member
Use the AND operator in your if statement...
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
Its a long line but it reduces it.
-
Aug 24th, 2000, 11:16 AM
#5
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Aug 24th, 2000, 01:09 PM
#6
Frenzied Member
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 
-
Aug 24th, 2000, 01:24 PM
#7
Thread Starter
Frenzied Member
no.... I need it so that if none of them are visible then the head is visible, not if any of them are visible
NXSupport - Your one-stop source for computer help
-
Aug 24th, 2000, 01:25 PM
#8
So Unbanned
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)
-
Aug 24th, 2000, 01:26 PM
#9
Frenzied Member
That's what my code does. The head will only appear if none of the body parts are visible.
-
Aug 24th, 2000, 01:33 PM
#10
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Aug 24th, 2000, 01:36 PM
#11
Lively Member
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)
-
Aug 24th, 2000, 04:05 PM
#12
New Member
A slight modification:
with frmMain
.imgHead.visible = Not(.imgArm.visible Or .imgArms.Visible Or .imgLeg.Visible Or .imgFeet.Visible)
End With
"I have a plan so cunning you could pin a tail on it and call it a weasel!" - Edmund Blackadder
-
Aug 24th, 2000, 05:34 PM
#13
New Member
can somone please make this into 3 lines:
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|