Results 1 to 3 of 3

Thread: Visible Objects

  1. #1

    Thread Starter
    Hyperactive Member gravyboy's Avatar
    Join Date
    Jan 2000
    Location
    Where I was before . . . if you don't know then you're new!
    Posts
    334

    Question

    I know that there is a quick way of detecting an object property and setting it to the opposite, rather than using If...Then...Else...End If.

    ie

    Code:
        If not lblAnyThing.Visible Then
           lblAnyThing.Visible=True
        Else
           lblAnyThing.Visible=False
        End If
    The only question is, what is it?



    [Edited by gravyboy on 06-05-2000 at 09:45 AM]
    Matt G
    VS6 Ent SP5 @ Work
    VS6 Ent SP5 & VB.Net @ Home
    [email protected]



  2. #2
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112
    I think this is what you are after.

    Code:
    lblAnything.Visible = Not lblAnything.Visible

  3. #3
    Fanatic Member HaxSoft's Avatar
    Join Date
    May 2000
    Location
    Ohio
    Posts
    593
    Alternatively, you could use the Xor operator on the visible property, like this:

    Code:
    lblAnything.Visible = lblAnything.Visible Xor True
    Just another way of doing it, I guess.

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