Monday, March 26, 2012

Web Control question (newbie)

I'm working through the ASP.Net Quick Start book and have managed to get
pretty confused about something. I've created a WebForm and am trying to
"place" a Label Web Form control on the form. I've got Grid mode turned on.

If I drag the control from the ToolBox I can drop it wherever I want
(subject to the grid of course). If however I just double click the control
then it gets placed in the upper left corner. Subsequently I'm unable to
drag it and place it elsewhere. When I attempt to drag the cursor changes
as though it's going to work, but when I release the mouse button the
control remains where it is. Also, if I use the first technique to place
it, then change (say) the font, then it ends up back in the corner.

So, can anyone explain this behaviour to me? Seems to me that I should be
able to place a control anywhere on the grid, even after it's been placed in
its original position.

Thanks in advance,
BillI, and most developers it seems, prefer Flow Layout. It is much more
flexible.
Grid Layout can be nice for some things, such as fixed size dialogs, but I
don't use it unless I have a good reason. I wish FlowLayout was the default
in Visual Studio.NET.
At least you can change this to be the default layout on a per project
basis.
In the solution explorer window, right click on your project and select
properties.
Then under Common Properties select Designer Defaults.
There you can set the default page layout for your project.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
news:ObR54QlpDHA.2940@.TK2MSFTNGP09.phx.gbl...
> I'm working through the ASP.Net Quick Start book and have managed to get
> pretty confused about something. I've created a WebForm and am trying to
> "place" a Label Web Form control on the form. I've got Grid mode turned
on.
> If I drag the control from the ToolBox I can drop it wherever I want
> (subject to the grid of course). If however I just double click the
control
> then it gets placed in the upper left corner. Subsequently I'm unable to
> drag it and place it elsewhere. When I attempt to drag the cursor changes
> as though it's going to work, but when I release the mouse button the
> control remains where it is. Also, if I use the first technique to place
> it, then change (say) the font, then it ends up back in the corner.
> So, can anyone explain this behaviour to me? Seems to me that I should be
> able to place a control anywhere on the grid, even after it's been placed
in
> its original position.
> Thanks in advance,
> Bill
You might also try just editing the HTML directly by
clicking the "html" tab in the bottom-left portion of
vs. It takes what's in your GUI designer and show it to
you in HTML format where you can edit it directly. I
usually get things close to the way I want them to look
in the GUI mode, then tweak in HTML.
Hope this helps,
-Larry
OK. But why does grid work so inconsistently? I thought the whole purpose
for the grid was so that you could place controls easily (as is the case
when you drag one off the toolbox.) Is this just a bug in VS? (BTW I'm using
VS.Net 2003)

Thanks for the response,
Bill
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:unGULllpDHA.2808@.TK2MSFTNGP10.phx.gbl...
> I, and most developers it seems, prefer Flow Layout. It is much more
> flexible.
> Grid Layout can be nice for some things, such as fixed size dialogs, but I
> don't use it unless I have a good reason. I wish FlowLayout was the
default
> in Visual Studio.NET.
> At least you can change this to be the default layout on a per project
> basis.
> In the solution explorer window, right click on your project and select
> properties.
> Then under Common Properties select Designer Defaults.
> There you can set the default page layout for your project.
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
> Hire top-notch developers at http://www.able-consulting.com
>
> "Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
> news:ObR54QlpDHA.2940@.TK2MSFTNGP09.phx.gbl...
> > I'm working through the ASP.Net Quick Start book and have managed to get
> > pretty confused about something. I've created a WebForm and am trying
to
> > "place" a Label Web Form control on the form. I've got Grid mode turned
> on.
> > If I drag the control from the ToolBox I can drop it wherever I want
> > (subject to the grid of course). If however I just double click the
> control
> > then it gets placed in the upper left corner. Subsequently I'm unable to
> > drag it and place it elsewhere. When I attempt to drag the cursor
changes
> > as though it's going to work, but when I release the mouse button the
> > control remains where it is. Also, if I use the first technique to
place
> > it, then change (say) the font, then it ends up back in the corner.
> > So, can anyone explain this behaviour to me? Seems to me that I should
be
> > able to place a control anywhere on the grid, even after it's been
placed
> in
> > its original position.
> > Thanks in advance,
> > Bill
Larry
Thanks for the response. Since I'm not "in the heat of battle" on a
project, but am simply trying to learn how to use VS.Net and ASP.Net I'm
more interested in understanding why I'm having this problem than I am in
working around it. Have you got any idea why I'm experiencing these problems
placing web form controls on a grid?

Thanks again,
Bill
"Larry Brindise" <larrya@.tradegear.com> wrote in message
news:065701c3a66c$2cd744d0$a001280a@.phx.gbl...
> You might also try just editing the HTML directly by
> clicking the "html" tab in the bottom-left portion of
> vs. It takes what's in your GUI designer and show it to
> you in HTML format where you can edit it directly. I
> usually get things close to the way I want them to look
> in the GUI mode, then tweak in HTML.
> Hope this helps,
> -Larry
OK, I've discovered the source of the problem. Somehow while experimenting
with the designer I added a SPAN element. Subsequent new web controls ended
up being placed within that span element. This (somehow) disabled the
control's ability to be repositioned. I don't yet understand the details for
this, but I think I can figure that out with a little more research/reading.

Onward...

Bill
"Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
news:ObR54QlpDHA.2940@.TK2MSFTNGP09.phx.gbl...
> I'm working through the ASP.Net Quick Start book and have managed to get
> pretty confused about something. I've created a WebForm and am trying to
> "place" a Label Web Form control on the form. I've got Grid mode turned
on.
> If I drag the control from the ToolBox I can drop it wherever I want
> (subject to the grid of course). If however I just double click the
control
> then it gets placed in the upper left corner. Subsequently I'm unable to
> drag it and place it elsewhere. When I attempt to drag the cursor changes
> as though it's going to work, but when I release the mouse button the
> control remains where it is. Also, if I use the first technique to place
> it, then change (say) the font, then it ends up back in the corner.
> So, can anyone explain this behaviour to me? Seems to me that I should be
> able to place a control anywhere on the grid, even after it's been placed
in
> its original position.
> Thanks in advance,
> Bill

0 comments:

Post a Comment