473,383 Members | 1,997 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,383 software developers and data experts.

Region.Makeinfinite has no effect

i have a control that uses a region to make it non rectangular

when i try to to remove the region by calling this.Region.Makeinfinite() the
control keeps its non rectangular Region.

if i call RecreateHandle() after calling Region.Makeinfinite() it works.

I Don't understand why it does not work if i don't call RecreateHandle();

Johan
Sep 3 '07 #1
1 1545
Sagaert Johan wrote:
i have a control that uses a region to make it non rectangular

when i try to to remove the region by calling this.Region.Makeinfinite() the
control keeps its non rectangular Region.

if i call RecreateHandle() after calling Region.Makeinfinite() it works.

I Don't understand why it does not work if i don't call RecreateHandle();
I don't either, not directly anyway. But...

What happens if you create a new region, initialized to infinite, and
assign that to the Region property?

The one thing I note here is that when you call MakeInfinite() on the
original region, the control instance itself has no direct way to be
aware of the change.

Recreating the underlying windows control handle obviously updates the
control using the changed region. But since the MSDN example shows
updating the region in the Paint handler (actually, that seems kind of
wrong to me, but what the heck), it seems likely that merely assigning a
new Region to the property may be sufficient to get the control to
update itself.

It seems to me that for something like changing the control's region,
recreating the handle may not be all that big of a problem anyway; the
latter would be required for a variety of major changes to the
fundamental behavior of the control, and the control's region does seem
to me to be at least marginally in that category. But it may be that
you can achieve the same effect in this particular case with a
less-intrusive technique.

Pete
Sep 3 '07 #2

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

Similar topics

8
by: Ryan R. Rosario | last post by:
Hi - **I apologize for posting this again. I dont think my first one went thru** I am in the process of converting a table based website over to a CSS based website and I am having a problem....
11
by: Altramagnus | last post by:
I have a complicated Region object, which I need to draw the outline, but not fill How can I convert the Region object to GraphicsPath object? or How can I draw the outline of the Region object?
6
by: John | last post by:
I have two books saying different things about the #region directive. One says that all code within #region does not affect the compilation process in any way, while the other states that the...
4
by: Frank Rizzo | last post by:
In vs.net 2003/c#, how can I collapse the region that I am currently in using the keyboard? Thanks
0
by: Piccinini Andrea | last post by:
Hi, I'have a class that contains a Region and I need to serialize it. I'm istalled ISerializable interface and I try to serialize Region as following; Serialize: ...
2
by: localhost | last post by:
I want to read an image from disk, get the total width, and then find the bottom region (say an area of 120 high x the total width) and fade-away each pixel by a percentage to white, and then...
2
by: Jack | last post by:
To whom may concern: In Asp.Net Calender control, how to display week days, like Wednesday as "Wed", Monday as "Mon", even my windows' region is set to Chinese? Thanks in advance! Jack...
4
by: Don | last post by:
When creating a new region for a control via a GraphicsPath object, it appears the entire rightmost column of pixels and bottom most row of pixels are not included in the region. I will try to...
1
by: PJ6 | last post by:
I've Googled this but come up short... I have a non-rectangular region that contains a moveable rectangle. I want to restrict the rectangle's movement to have it always fully contained in this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.