Results 1 to 2 of 2

Thread: Finding all controls within a rect?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421

    Finding all controls within a rect?

    I need a function that will determine whether or not any part of a control is in a RECT. For example, whe you drag to select a number of controls in VB at design time, it will select the control even if the RECT doesn't completely surround it.

    Attached is the method I'm using at the moment, but it won't select the shape if you try to select anything besides one of the corners. Any help at all would be appreciated.

    BTW: I am using this for a game, but I was testing it on a shape so I could implement it later in the game.
    Attached Files Attached Files
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  2. #2
    Addicted Member
    Join Date
    Oct 2002
    Location
    Somewhere out in space
    Posts
    151
    use the IntersectRect to determine if two rect are intercepting each other.

    i've uploaded an updated version of your project

    hope that will help.

    - Valkan
    Attached Files Attached Files
    'You keep creatures in cages and release them to fight? That's sick!'

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