Results 1 to 13 of 13

Thread: can somone please make this into 3 lines:

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    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

  2. #2
    Hyperactive Member theman32x's Avatar
    Join Date
    May 2000
    Location
    New Jersey, USA
    Posts
    305
    are you trying to do a hangman game?

    i can't really help cause i usually write unneccessary lines myself.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    yea acctually I am (its kinda obvious)
    NXSupport - Your one-stop source for computer help

  4. #4
    Lively Member
    Join Date
    May 2000
    Posts
    84
    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.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    THANKS
    NXSupport - Your one-stop source for computer help

  6. #6
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    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

  8. #8
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    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)

  9. #9
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    That's what my code does. The head will only appear if none of the body parts are visible.

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    in that case, thanks
    NXSupport - Your one-stop source for computer help

  11. #11
    Lively Member
    Join Date
    May 2000
    Posts
    84
    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)

  12. #12
    New Member
    Join Date
    Aug 2000
    Location
    Vancouver BC
    Posts
    4
    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

  13. #13
    New Member
    Join Date
    Aug 2000
    Posts
    6

    Wink 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
  •  



Click Here to Expand Forum to Full Width