473,767 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

When I set the location property for a control, stack overflows

I have a Control derived class. When the parent of the control changes the
control's Location property, the stack overflows. I have not found a way to
find out what was on the stack when it does overflow. All I know is that
the program is either stopped due to an exception at the end of Main or has
exited after the Stack Overflow exception. (Both cases are Debug builds
running in the debugger.)

After a lot of trial and error (mostly the latter with a dose of confusion
thrown in), I finally tracked the last statement of mine executed to a line
where, as mentioned, the parent sets the child's location. The location
property is not overridden. I have not subscribed to the child's
LocationChanged event.

I tried full rebuilds in case the executable was corrupt. I tried rebooting
in case Windows was the cause. Neither helped.

Any ideas?
----------
Will Pittenger
E-Mail: mailto:will.pit tenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)
Jul 31 '05
13 2086
Sorry, I do not know how I missed that. I should have seen that. Why would
that blow up when Location was set?
----------
Will Pittenger
E-Mail: mailto:will.pit tenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)

"Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in message
news:Os******** *****@TK2MSFTNG P09.phx.gbl...
You're "memGraphic sDC" class had a good number of method calls that needed
to be translated, using best guess, too. It wasn't as simple as just
swapping out "memGraphic sDC" with Graphics. I also got a few exceptions,
all
resource related, when I finally got it to compile and run. Some of the
main
reasons why a complete example that just unzips and repros the issue is a
good idea. The issue turns out to be that you were referencing the Size
property from within the "getter" of the Size property definition. So it
just keeps calling itself which eventually results in a stack overflow.
You'll need to change the code to call to the base as shown below.

// Old
public new System.Drawing. Size Size
{
get
{
return Size;
}
set
{
...
}
}

// New
public new System.Drawing. Size Size
{
get
{
return base.Size;
}
set
{
...
}
}

--
Tim Wilson
.Net Compact Framework MVP

"Will Pittenger" <se***********@ see.signature.n et> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Actually, I thought up a better way overnight. The form that
instantiates
the header (rather than another control for now) is quite small. I have
difficulty believing you need much more. This class would probably help

as
it would create the header within a header that triggered the problem.

That
was the header inside the Name column. The main header is docked and
does
not appear to have an issue with its location property.
----------
Will Pittenger
E-Mail: mailto:will.pit tenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)

"Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in
message
news:up******** ******@TK2MSFTN GP10.phx.gbl...
> Just shoot the zip over to the following email account and I can pick
> it
> up
> from there. The email address is, of course, mangled.
> dllhell [remove] AT hotmail [dot] com
>
> --
> Tim Wilson
> .Net Compact Framework MVP
>
> "Will Pittenger" <se***********@ see.signature.n et> wrote in message
> news:e6******** ******@TK2MSFTN GP15.phx.gbl...
>> I have no way to get it onto the server. The text file unzipped was only >> 101K. That was refused until I zipped it. The solution would be much
>> larger even zipped. (MS must be skimping there.)
>>
>> The memGraphicsDC class is nothing special. I was actually about to
> remove
>> it due to .NET having everything it was meant to do. Replace the
>> memGraphicsDC parameters with a Graphics object and replace any
>> references
>> to memDC.DrawSurfa ce with that Graphics object. In the paint handler,
>> use
>> the paint event argument handler for the Graphics object.
>> ----------
>> Will Pittenger
>> E-Mail: mailto:will.pit tenger1 at gmail.com
>> All mail filtered by Qurb (www.qurb.com)
>>
>> "Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in
>> message
>> news:um******** ******@TK2MSFTN GP09.phx.gbl...
>> > Can you post an entire solution containing your custom UserControl, all >> > supporting custom classes, and a win forms application that
>> > demonstrates
>> > the
>> > problem at runtime? Ideally if I could have something that I can
>> > just
>> > unzip,
>> > load into VS, and then hit F5 and watch it blow up then at least I
>> > could
>> > start helping after I see the problem. The code that you posted doesn't >> > compile because it's missing a definition for "memGraphicsDC" . And once > I
>> > get it to compile I'll need to be able to reproduce the error. So it's > for
>> > these two reasons that it would be nice to have an entire solution
> (zipped
>> > of course).
>> >
>> > --
>> > Tim Wilson
>> > .Net Compact Framework MVP
>> >
>> > "Will Pittenger" <se***********@ see.signature.n et> wrote in message
>> > news:uL******** ******@tk2msftn gp13.phx.gbl...
>> >> The class has just over 3000 lines. (Several nested classes are
>> > included.)
>> >> I am attaching the entire class. If I attempt to simplify the
>> >> file,
> the
>> >> problem would probably disappear. It would also take me a while to
>> >> get
>> > the
>> >> code to work again. The class is intended to be a header (like the
>> >> one
>> >> in
>> >> Explorer). Normally, the header would always be docked. One of
>> >> the
>> > nested
>> >> classes (colDef) represents one of the columns. It serves as the
>> >> column's
>> >> definition (hence the name) and paints the column inside the
>> >> header.
>> >>
>> >> Now, I brought colDef up because I built in a way to allow the column > to
>> >> host a header. This allows for, say a name field, to be split into
>> > several
>> >> fields. (In that case: First Name, Middle Initial, and Last Name.)
> When
>> >> the header is the top level header, it is, as mentioned, docked and
> there
>> > is
>> >> no problem. When a column hosts the header, it puts the header
>> >> into
>> >> position with the fixChildHeaderP osAndSize member.
>> >> ----------
>> >> Will Pittenger
>> >> E-Mail: mailto:will.pit tenger1 at gmail.com
>> >> All mail filtered by Qurb (www.qurb.com)
>> >>
>> >> "Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in
>> >> message
>> >> news:OF******** ********@TK2MSF TNGP10.phx.gbl. ..
>> >> > Can you post the complete source code for your custom control, as
> well
>> > as
>> >> > the code that's being used to instantiate the control and add it to > the
>> >> > container, so we can take a look at it?
>> >> >
>> >> > --
>> >> > Tim Wilson
>> >> > .Net Compact Framework MVP
>> >> >
>> >> > "Will Pittenger" <se***********@ see.signature.n et> wrote in message >> >> > news:Or******** ******@TK2MSFTN GP09.phx.gbl...
>> >> >> I have a Control derived class. When the parent of the control
>> >> >> changes
>> >> > the
>> >> >> control's Location property, the stack overflows. I have not found > a
>> > way
>> >> > to
>> >> >> find out what was on the stack when it does overflow. All I
>> >> >> know
>> >> >> is
>> > that
>> >> >> the program is either stopped due to an exception at the end of
>> >> >> Main
>> >> >> or
>> >> > has
>> >> >> exited after the Stack Overflow exception. (Both cases are
>> >> >> Debug
>> > builds
>> >> >> running in the debugger.)
>> >> >>
>> >> >> After a lot of trial and error (mostly the latter with a dose of
>> >> >> confusion
>> >> >> thrown in), I finally tracked the last statement of mine
>> >> >> executed
>> >> >> to
> a
>> >> > line
>> >> >> where, as mentioned, the parent sets the child's location. The
>> > location
>> >> >> property is not overridden. I have not subscribed to the
>> >> >> child's
>> >> >> LocationChanged event.
>> >> >>
>> >> >> I tried full rebuilds in case the executable was corrupt. I tried >> >> > rebooting
>> >> >> in case Windows was the cause. Neither helped.
>> >> >>
>> >> >> Any ideas?
>> >> >> ----------
>> >> >> Will Pittenger
>> >> >> E-Mail: mailto:will.pit tenger1 at gmail.com
>> >> >> All mail filtered by Qurb (www.qurb.com)
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Aug 1 '05 #11
I'm not sure. I didn't look into why the Size property was being called, I
just went to the point of locating the recursion that was happening within
the Size property itself.

--
Tim Wilson
..Net Compact Framework MVP

"Will Pittenger" <se***********@ see.signature.n et> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Sorry, I do not know how I missed that. I should have seen that. Why would that blow up when Location was set?
----------
Will Pittenger
E-Mail: mailto:will.pit tenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)

"Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in message
news:Os******** *****@TK2MSFTNG P09.phx.gbl...
You're "memGraphic sDC" class had a good number of method calls that needed to be translated, using best guess, too. It wasn't as simple as just
swapping out "memGraphic sDC" with Graphics. I also got a few exceptions,
all
resource related, when I finally got it to compile and run. Some of the
main
reasons why a complete example that just unzips and repros the issue is a good idea. The issue turns out to be that you were referencing the Size
property from within the "getter" of the Size property definition. So it
just keeps calling itself which eventually results in a stack overflow.
You'll need to change the code to call to the base as shown below.

// Old
public new System.Drawing. Size Size
{
get
{
return Size;
}
set
{
...
}
}

// New
public new System.Drawing. Size Size
{
get
{
return base.Size;
}
set
{
...
}
}

--
Tim Wilson
.Net Compact Framework MVP

"Will Pittenger" <se***********@ see.signature.n et> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Actually, I thought up a better way overnight. The form that
instantiates
the header (rather than another control for now) is quite small. I have difficulty believing you need much more. This class would probably help
as
it would create the header within a header that triggered the problem.

That
was the header inside the Name column. The main header is docked and
does
not appear to have an issue with its location property.
----------
Will Pittenger
E-Mail: mailto:will.pit tenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)

"Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in
message
news:up******** ******@TK2MSFTN GP10.phx.gbl...
> Just shoot the zip over to the following email account and I can pick
> it
> up
> from there. The email address is, of course, mangled.
> dllhell [remove] AT hotmail [dot] com
>
> --
> Tim Wilson
> .Net Compact Framework MVP
>
> "Will Pittenger" <se***********@ see.signature.n et> wrote in message
> news:e6******** ******@TK2MSFTN GP15.phx.gbl...
>> I have no way to get it onto the server. The text file unzipped was

only
>> 101K. That was refused until I zipped it. The solution would be
much >> larger even zipped. (MS must be skimping there.)
>>
>> The memGraphicsDC class is nothing special. I was actually about to
> remove
>> it due to .NET having everything it was meant to do. Replace the
>> memGraphicsDC parameters with a Graphics object and replace any
>> references
>> to memDC.DrawSurfa ce with that Graphics object. In the paint handler, >> use
>> the paint event argument handler for the Graphics object.
>> ----------
>> Will Pittenger
>> E-Mail: mailto:will.pit tenger1 at gmail.com
>> All mail filtered by Qurb (www.qurb.com)
>>
>> "Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in
>> message
>> news:um******** ******@TK2MSFTN GP09.phx.gbl...
>> > Can you post an entire solution containing your custom UserControl, all
>> > supporting custom classes, and a win forms application that
>> > demonstrates
>> > the
>> > problem at runtime? Ideally if I could have something that I can
>> > just
>> > unzip,
>> > load into VS, and then hit F5 and watch it blow up then at least I
>> > could
>> > start helping after I see the problem. The code that you posted

doesn't
>> > compile because it's missing a definition for "memGraphicsDC" . And

once
> I
>> > get it to compile I'll need to be able to reproduce the error. So

it's
> for
>> > these two reasons that it would be nice to have an entire solution
> (zipped
>> > of course).
>> >
>> > --
>> > Tim Wilson
>> > .Net Compact Framework MVP
>> >
>> > "Will Pittenger" <se***********@ see.signature.n et> wrote in
message >> > news:uL******** ******@tk2msftn gp13.phx.gbl...
>> >> The class has just over 3000 lines. (Several nested classes are
>> > included.)
>> >> I am attaching the entire class. If I attempt to simplify the
>> >> file,
> the
>> >> problem would probably disappear. It would also take me a while to >> >> get
>> > the
>> >> code to work again. The class is intended to be a header (like the >> >> one
>> >> in
>> >> Explorer). Normally, the header would always be docked. One of
>> >> the
>> > nested
>> >> classes (colDef) represents one of the columns. It serves as the
>> >> column's
>> >> definition (hence the name) and paints the column inside the
>> >> header.
>> >>
>> >> Now, I brought colDef up because I built in a way to allow the

column
> to
>> >> host a header. This allows for, say a name field, to be split into >> > several
>> >> fields. (In that case: First Name, Middle Initial, and Last Name.) > When
>> >> the header is the top level header, it is, as mentioned, docked and > there
>> > is
>> >> no problem. When a column hosts the header, it puts the header
>> >> into
>> >> position with the fixChildHeaderP osAndSize member.
>> >> ----------
>> >> Will Pittenger
>> >> E-Mail: mailto:will.pit tenger1 at gmail.com
>> >> All mail filtered by Qurb (www.qurb.com)
>> >>
>> >> "Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in >> >> message
>> >> news:OF******** ********@TK2MSF TNGP10.phx.gbl. ..
>> >> > Can you post the complete source code for your custom control, as > well
>> > as
>> >> > the code that's being used to instantiate the control and add it to
> the
>> >> > container, so we can take a look at it?
>> >> >
>> >> > --
>> >> > Tim Wilson
>> >> > .Net Compact Framework MVP
>> >> >
>> >> > "Will Pittenger" <se***********@ see.signature.n et> wrote in

message
>> >> > news:Or******** ******@TK2MSFTN GP09.phx.gbl...
>> >> >> I have a Control derived class. When the parent of the

control >> >> >> changes
>> >> > the
>> >> >> control's Location property, the stack overflows. I have not

found
> a
>> > way
>> >> > to
>> >> >> find out what was on the stack when it does overflow. All I
>> >> >> know
>> >> >> is
>> > that
>> >> >> the program is either stopped due to an exception at the end of >> >> >> Main
>> >> >> or
>> >> > has
>> >> >> exited after the Stack Overflow exception. (Both cases are
>> >> >> Debug
>> > builds
>> >> >> running in the debugger.)
>> >> >>
>> >> >> After a lot of trial and error (mostly the latter with a dose of >> >> >> confusion
>> >> >> thrown in), I finally tracked the last statement of mine
>> >> >> executed
>> >> >> to
> a
>> >> > line
>> >> >> where, as mentioned, the parent sets the child's location. The >> > location
>> >> >> property is not overridden. I have not subscribed to the
>> >> >> child's
>> >> >> LocationChanged event.
>> >> >>
>> >> >> I tried full rebuilds in case the executable was corrupt. I

tried
>> >> > rebooting
>> >> >> in case Windows was the cause. Neither helped.
>> >> >>
>> >> >> Any ideas?
>> >> >> ----------
>> >> >> Will Pittenger
>> >> >> E-Mail: mailto:will.pit tenger1 at gmail.com
>> >> >> All mail filtered by Qurb (www.qurb.com)
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Aug 1 '05 #12
The more I think about it, it depends on how much .NET relies on Win32 calls
to do simple things. (I worked with MFC/C++ for close to a decade before
getting C#.) Windows stores rectangles using the lower right corner rather
than the size. If Windows is relying on .NET to track that rect, .NET is
going to use the Size property. Does that make sense?
----------
Will Pittenger
E-Mail: mailto:will.pit tenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)

"Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in message
news:up******** ******@TK2MSFTN GP10.phx.gbl...
I'm not sure. I didn't look into why the Size property was being called, I
just went to the point of locating the recursion that was happening within
the Size property itself.

--
Tim Wilson
.Net Compact Framework MVP

"Will Pittenger" <se***********@ see.signature.n et> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Sorry, I do not know how I missed that. I should have seen that. Why

would
that blow up when Location was set?
----------
Will Pittenger
E-Mail: mailto:will.pit tenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)

"Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in
message
news:Os******** *****@TK2MSFTNG P09.phx.gbl...
> You're "memGraphic sDC" class had a good number of method calls that needed > to be translated, using best guess, too. It wasn't as simple as just
> swapping out "memGraphic sDC" with Graphics. I also got a few
> exceptions,
> all
> resource related, when I finally got it to compile and run. Some of the
> main
> reasons why a complete example that just unzips and repros the issue is a > good idea. The issue turns out to be that you were referencing the Size
> property from within the "getter" of the Size property definition. So
> it
> just keeps calling itself which eventually results in a stack overflow.
> You'll need to change the code to call to the base as shown below.
>
> // Old
> public new System.Drawing. Size Size
> {
> get
> {
> return Size;
> }
> set
> {
> ...
> }
> }
>
> // New
> public new System.Drawing. Size Size
> {
> get
> {
> return base.Size;
> }
> set
> {
> ...
> }
> }
>
> --
> Tim Wilson
> .Net Compact Framework MVP
>
> "Will Pittenger" <se***********@ see.signature.n et> wrote in message
> news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
>> Actually, I thought up a better way overnight. The form that
>> instantiates
>> the header (rather than another control for now) is quite small. I have >> difficulty believing you need much more. This class would probably help > as
>> it would create the header within a header that triggered the problem.
> That
>> was the header inside the Name column. The main header is docked and
>> does
>> not appear to have an issue with its location property.
>> ----------
>> Will Pittenger
>> E-Mail: mailto:will.pit tenger1 at gmail.com
>> All mail filtered by Qurb (www.qurb.com)
>>
>> "Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in
>> message
>> news:up******** ******@TK2MSFTN GP10.phx.gbl...
>> > Just shoot the zip over to the following email account and I can
>> > pick
>> > it
>> > up
>> > from there. The email address is, of course, mangled.
>> > dllhell [remove] AT hotmail [dot] com
>> >
>> > --
>> > Tim Wilson
>> > .Net Compact Framework MVP
>> >
>> > "Will Pittenger" <se***********@ see.signature.n et> wrote in message
>> > news:e6******** ******@TK2MSFTN GP15.phx.gbl...
>> >> I have no way to get it onto the server. The text file unzipped
>> >> was
> only
>> >> 101K. That was refused until I zipped it. The solution would be much >> >> larger even zipped. (MS must be skimping there.)
>> >>
>> >> The memGraphicsDC class is nothing special. I was actually about
>> >> to
>> > remove
>> >> it due to .NET having everything it was meant to do. Replace the
>> >> memGraphicsDC parameters with a Graphics object and replace any
>> >> references
>> >> to memDC.DrawSurfa ce with that Graphics object. In the paint handler, >> >> use
>> >> the paint event argument handler for the Graphics object.
>> >> ----------
>> >> Will Pittenger
>> >> E-Mail: mailto:will.pit tenger1 at gmail.com
>> >> All mail filtered by Qurb (www.qurb.com)
>> >>
>> >> "Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in
>> >> message
>> >> news:um******** ******@TK2MSFTN GP09.phx.gbl...
>> >> > Can you post an entire solution containing your custom UserControl, > all
>> >> > supporting custom classes, and a win forms application that
>> >> > demonstrates
>> >> > the
>> >> > problem at runtime? Ideally if I could have something that I can
>> >> > just
>> >> > unzip,
>> >> > load into VS, and then hit F5 and watch it blow up then at least
>> >> > I
>> >> > could
>> >> > start helping after I see the problem. The code that you posted
> doesn't
>> >> > compile because it's missing a definition for "memGraphicsDC" .
>> >> > And
> once
>> > I
>> >> > get it to compile I'll need to be able to reproduce the error. So
> it's
>> > for
>> >> > these two reasons that it would be nice to have an entire
>> >> > solution
>> > (zipped
>> >> > of course).
>> >> >
>> >> > --
>> >> > Tim Wilson
>> >> > .Net Compact Framework MVP
>> >> >
>> >> > "Will Pittenger" <se***********@ see.signature.n et> wrote in message >> >> > news:uL******** ******@tk2msftn gp13.phx.gbl...
>> >> >> The class has just over 3000 lines. (Several nested classes are
>> >> > included.)
>> >> >> I am attaching the entire class. If I attempt to simplify the
>> >> >> file,
>> > the
>> >> >> problem would probably disappear. It would also take me a while to >> >> >> get
>> >> > the
>> >> >> code to work again. The class is intended to be a header (like the >> >> >> one
>> >> >> in
>> >> >> Explorer). Normally, the header would always be docked. One of
>> >> >> the
>> >> > nested
>> >> >> classes (colDef) represents one of the columns. It serves as
>> >> >> the
>> >> >> column's
>> >> >> definition (hence the name) and paints the column inside the
>> >> >> header.
>> >> >>
>> >> >> Now, I brought colDef up because I built in a way to allow the
> column
>> > to
>> >> >> host a header. This allows for, say a name field, to be split into >> >> > several
>> >> >> fields. (In that case: First Name, Middle Initial, and Last Name.) >> > When
>> >> >> the header is the top level header, it is, as mentioned, docked and >> > there
>> >> > is
>> >> >> no problem. When a column hosts the header, it puts the header
>> >> >> into
>> >> >> position with the fixChildHeaderP osAndSize member.
>> >> >> ----------
>> >> >> Will Pittenger
>> >> >> E-Mail: mailto:will.pit tenger1 at gmail.com
>> >> >> All mail filtered by Qurb (www.qurb.com)
>> >> >>
>> >> >> "Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in >> >> >> message
>> >> >> news:OF******** ********@TK2MSF TNGP10.phx.gbl. ..
>> >> >> > Can you post the complete source code for your custom control, as >> > well
>> >> > as
>> >> >> > the code that's being used to instantiate the control and add it > to
>> > the
>> >> >> > container, so we can take a look at it?
>> >> >> >
>> >> >> > --
>> >> >> > Tim Wilson
>> >> >> > .Net Compact Framework MVP
>> >> >> >
>> >> >> > "Will Pittenger" <se***********@ see.signature.n et> wrote in
> message
>> >> >> > news:Or******** ******@TK2MSFTN GP09.phx.gbl...
>> >> >> >> I have a Control derived class. When the parent of the control >> >> >> >> changes
>> >> >> > the
>> >> >> >> control's Location property, the stack overflows. I have not
> found
>> > a
>> >> > way
>> >> >> > to
>> >> >> >> find out what was on the stack when it does overflow. All I
>> >> >> >> know
>> >> >> >> is
>> >> > that
>> >> >> >> the program is either stopped due to an exception at the end of >> >> >> >> Main
>> >> >> >> or
>> >> >> > has
>> >> >> >> exited after the Stack Overflow exception. (Both cases are
>> >> >> >> Debug
>> >> > builds
>> >> >> >> running in the debugger.)
>> >> >> >>
>> >> >> >> After a lot of trial and error (mostly the latter with a dose of >> >> >> >> confusion
>> >> >> >> thrown in), I finally tracked the last statement of mine
>> >> >> >> executed
>> >> >> >> to
>> > a
>> >> >> > line
>> >> >> >> where, as mentioned, the parent sets the child's location. The >> >> > location
>> >> >> >> property is not overridden. I have not subscribed to the
>> >> >> >> child's
>> >> >> >> LocationChanged event.
>> >> >> >>
>> >> >> >> I tried full rebuilds in case the executable was corrupt. I
> tried
>> >> >> > rebooting
>> >> >> >> in case Windows was the cause. Neither helped.
>> >> >> >>
>> >> >> >> Any ideas?
>> >> >> >> ----------
>> >> >> >> Will Pittenger
>> >> >> >> E-Mail: mailto:will.pit tenger1 at gmail.com
>> >> >> >> All mail filtered by Qurb (www.qurb.com)
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>>
>
>



Aug 2 '05 #13
I don't think that the problem lies with the way .NET is doing things. If
you take, for example, the following code, create an instance of the
MyButton class, and then set the Location property, the Size property is not
called. You can set breakpoints in both the set and get and neither will be
called. Maybe there is something else in your code that is causing the call
to the Size property.

public class MyButton : System.Windows. Forms.Button
{
public new Size Size
{
get
{
return base.Size;
}
set
{
base.Size = value;
}
}
}

--
Tim Wilson
..Net Compact Framework MVP

"Will Pittenger" <se***********@ see.signature.n et> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
The more I think about it, it depends on how much .NET relies on Win32 calls to do simple things. (I worked with MFC/C++ for close to a decade before
getting C#.) Windows stores rectangles using the lower right corner rather than the size. If Windows is relying on .NET to track that rect, .NET is
going to use the Size property. Does that make sense?
----------
Will Pittenger
E-Mail: mailto:will.pit tenger1 at gmail.com
All mail filtered by Qurb (www.qurb.com)

Aug 2 '05 #14

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

Similar topics

15
7740
by: Andrew | last post by:
Last night I was reading about implementing my own stack. The example given pushes items on and off the stack at the start and end of each procedure (ie. in a std module). What's not so clear is how this would work with class objects. In this case do you have to push the object on the stack at the start of every public procedure etc. in the class and pop it off at the end? I can't see how else you can know which object is active - or...
13
1186
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does overflow. All I know is that the program is either stopped due to an exception at the end of Main or has exited after the Stack Overflow exception. (Both cases are Debug builds running in the debugger.) After a lot of trial and error (mostly...
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10009
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.