Home All Groups Group Topic Archive Search About

Is setting Bounds Property the same as setting Size and Location?

Author
26 Nov 2007 7:27 PM
Academia
Is there a difference between setting Control.Bounds Property (or using
Control.SetBoundsCore ) and setting the Location and the Size properties?

Is it simply that you can set them all at once rather that in two steps or
is there more to it than that?


Thanks

Author
26 Nov 2007 8:03 PM
Tom Shelton
On Nov 26, 12:27 pm, "Academia" <academiaNOS***@a-znet.com> wrote:
> Is there a difference between setting Control.Bounds Property (or using
> Control.SetBoundsCore ) and setting the Location and the Size properties?
>
> Is it simply that you can set them all at once rather that in two steps or
> is there more to it than that?
>
> Thanks

The big difference I can see from the documentation, is that Bounds
sets the location relative to the non-client area.  In other words, it
doesn't take into consideration the width of borders, etc, etc.  So,
you would need to make sure that you were accounting for non-client
areas in the coordinates.

--
Tom Shelton
Author
27 Nov 2007 7:48 AM
Academia
Show quote Hide quote
"Tom Shelton" <tom_shel***@comcast.net> wrote in message
news:c9d700c7-dc78-4cfc-9818-3bb63caafc90@b40g2000prf.googlegroups.com...
> On Nov 26, 12:27 pm, "Academia" <academiaNOS***@a-znet.com> wrote:
>> Is there a difference between setting Control.Bounds Property (or using
>> Control.SetBoundsCore ) and setting the Location and the Size properties?
>>
>> Is it simply that you can set them all at once rather that in two steps
>> or
>> is there more to it than that?
>>
>> Thanks
>
> The big difference I can see from the documentation, is that Bounds
> sets the location relative to the non-client area.  In other words, it
> doesn't take into consideration the width of borders, etc, etc.  So,
> you would need to make sure that you were accounting for non-client
> areas in the coordinates.
>
> --
> Tom Shelton

Isn't that the same as what the Size property does?

Thanks
Author
27 Nov 2007 9:24 AM
Armin Zingler
Show quote Hide quote
"Academia" <academiaNOSPAM@a-znet.com> schrieb
>
> "Tom Shelton" <tom_shel***@comcast.net> wrote in message
> news:c9d700c7-dc78-4cfc-9818-3bb63caafc90@b40g2000prf.googlegroups.com...
> > On Nov 26, 12:27 pm, "Academia" <academiaNOS***@a-znet.com> wrote:
> > > Is there a difference between setting Control.Bounds Property
> > > (or using Control.SetBoundsCore ) and setting the Location and
> > > the Size properties?
> > >
> > > Is it simply that you can set them all at once rather that in
> > > two steps or
> > > is there more to it than that?
> > >
> > > Thanks
> >
> > The big difference I can see from the documentation, is that
> > Bounds sets the location relative to the non-client area.  In
> > other words, it doesn't take into consideration the width of
> > borders, etc, etc.  So, you would need to make sure that you were
> > accounting for non-client areas in the coordinates.
> >
> > --
> > Tom Shelton
>
> Isn't that the same as what the Size property does?


Bounds is equal to x,y, width, height. Size is equal to width, height.
Location is equal to x, y. Equal means identical, as the IL code says.


Armin
Author
27 Nov 2007 3:58 PM
Tom Shelton
Show quote Hide quote
On Nov 27, 12:48 am, "Academia" <academiaNOS***@a-znet.com> wrote:
> "Tom Shelton" <tom_shel***@comcast.net> wrote in message
>
> news:c9d700c7-dc78-4cfc-9818-3bb63caafc90@b40g2000prf.googlegroups.com...
>
>
>
>
>
> > On Nov 26, 12:27 pm, "Academia" <academiaNOS***@a-znet.com> wrote:
> >> Is there a difference between setting Control.Bounds Property (or using
> >> Control.SetBoundsCore ) and setting the Location and the Size properties?
>
> >> Is it simply that you can set them all at once rather that in two steps
> >> or
> >> is there more to it than that?
>
> >> Thanks
>
> > The big difference I can see from the documentation, is that Bounds
> > sets the location relative to the non-client area.  In other words, it
> > doesn't take into consideration the width of borders, etc, etc.  So,
> > you would need to make sure that you were accounting for non-client
> > areas in the coordinates.
>
> > --
> > Tom Shelton
>
> Isn't that the same as what the Size property does?
>
> Thanks- Hide quoted text -
>
> - Show quoted text -

I just did an experiement, and though the documentation seems to
indicate that setting Bounds does not take in to consideration the
client area of the form, that seems not to be true.  It appears that
using bounds to set size and location is identicle to setting them
individually.

--
Tom Shelton
Author
27 Nov 2007 5:57 PM
Academia
Show quote Hide quote
"Tom Shelton" <tom_shel***@comcast.net> wrote in message
news:adf9ad39-5ab7-4054-9d7f-281226ea7b77@a35g2000prf.googlegroups.com...
> On Nov 27, 12:48 am, "Academia" <academiaNOS***@a-znet.com> wrote:
>> "Tom Shelton" <tom_shel***@comcast.net> wrote in message
>>
>> news:c9d700c7-dc78-4cfc-9818-3bb63caafc90@b40g2000prf.googlegroups.com...
>>
>>
>>
>>
>>
>> > On Nov 26, 12:27 pm, "Academia" <academiaNOS***@a-znet.com> wrote:
>> >> Is there a difference between setting Control.Bounds Property (or
>> >> using
>> >> Control.SetBoundsCore ) and setting the Location and the Size
>> >> properties?
>>
>> >> Is it simply that you can set them all at once rather that in two
>> >> steps
>> >> or
>> >> is there more to it than that?
>>
>> >> Thanks
>>
>> > The big difference I can see from the documentation, is that Bounds
>> > sets the location relative to the non-client area.  In other words, it
>> > doesn't take into consideration the width of borders, etc, etc.  So,
>> > you would need to make sure that you were accounting for non-client
>> > areas in the coordinates.
>>
>> > --
>> > Tom Shelton
>>
>> Isn't that the same as what the Size property does?
>>
>> Thanks- Hide quoted text -
>>
>> - Show quoted text -
>
> I just did an experiement, and though the documentation seems to
> indicate that setting Bounds does not take in to consideration the
> client area of the form, that seems not to be true.  It appears that
> using bounds to set size and location is identicle to setting them
> individually.
>
> --
> Tom Shelton

I asked because I found the Bounds documentation confusing and was looking
for someone like yourself who has more insight into DotNet to comment.

Thanks