473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Region visible in another Region?

Another question for ye all..

How do i check if a Region has entered another region?

Up until now, i've been checking if rectangles (or images converted into
Rectangles) have been visible in a Region (Region.IsVisible) but all
parameters in IsVisible seem to be for Rectangles / points.

To check if a Region is in another Region, i'd probably have to use the
Region.Intersect.. am i on the right track?

Many thanks in advance.

Brian
Nov 16 '05 #1
2 3145
First of all check the region bounds and then, if they overlap, intersect
the two regions and see if the result is empty or not.
--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Brian Basquille" <re**********@please.com> wrote in message
news:eB****************@TK2MSFTNGP10.phx.gbl...
Another question for ye all..

How do i check if a Region has entered another region?

Up until now, i've been checking if rectangles (or images converted into
Rectangles) have been visible in a Region (Region.IsVisible) but all
parameters in IsVisible seem to be for Rectangles / points.

To check if a Region is in another Region, i'd probably have to use the
Region.Intersect.. am i on the right track?

Many thanks in advance.

Brian

Nov 16 '05 #2
Cheers Bob.

I presumed you would have to use Region.Intersect.

However, this is the one area in Region that i have the problem... have
tried using Region.Intersect but how do i work with it if it has a void
return type?

This is my problem:

The two regions i have are rgnPaddle1 and rgnPuck.

I need to check for an intersection between the two regions so i presume
something like:
intersection = rgnPaddle1.Intersect(rgnPuck)

if(intersection!= null)
puckHit = true;

if(puckHit == true)
{
// carry out actions (puck has been hit)
}

But like i said.. Region.Intersect() has void return type.

Any more suggestions on how to implement this?

Thanks again Bob.

Brian
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jim | last post by:
Are #region a bad thing or are they good? As far as I see it #region's are a bad thing as they let lazy programmmers have large and bloated methods divided into regions that then appear as small...
1
by: Steven T. Hatton | last post by:
All of the following terms are used in some way to describe where and how a name is relevant to a particular location in a program: visible, declarative region, scope, potential scope, valid,...
0
by: =?Utf-8?B?QXR1bCBSYW5l?= | last post by:
Hi, I am using datagridview when, I am assigning datasource to Datagridview i am gettin exception "Child list for field Region cannot be created." I am Assigning Collection as a datasource to...
6
by: sureshl | last post by:
In my calandar_selectionchanged event .. am showing a div region in my page on the top of the calendar . Like www.bytes.com on clicking Login You will find a small page opens similarly which i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.