Repositioning Panels at Runtime

  • Thread starter Thread starter George
  • Start date Start date
G

George

In my Webform I am building in VS.NET, I need to position and reposition a
number of panels at runtime from within my Code Behind. Can someone tell me
what namespaces I need to import, what the code is, and where, exactly I put
that code.

In addtion to the...

<%@ Page Language="vb" (etc, etc.) %>

....at the very top of my HTML source, I also have...

<%@ Import Namespace="System.Drawing" %>

I thought that was all I needed to use...

Panel1.Location = New Point(x,x)

....in my Code Behind, but it doesn't allow it. I get those little squiggle
lines underneath it.

What am I doing wrong?

Thanks,
George
 
Hi George,

As far as I know, you cannot.

To position it you can put a Panel on your screen and inside that panel you
can position by using the Me.Panel1.Controls.Add(New LiteralControl("<BR>"))
and things like that.

The panel.location is from a windowsform not from a webform, do not mix the
controls from a webform with the same name up with a windowforms.

The only one which is really a little bit look alike is the label (but with
exception the location and the height and width by instance)

Although I know not a real nice answer do I hope this helps?

Cor
 
Hey Cor,

That's probably why I couldn't get it to work! ;-) I didn't know that
panel.location was for Windows Forms only.

I need to allow a visitor to my Web site to turn the panel.visible on and
off for about six different areas on a page, all six areas are stacked
vertically on the page.

When I use panels to do this, I end up with different size gaps between
them, depending on which ones are visible. It doesn't look very good like
that, and need some way to control panel locations from a relative or
absolute reference point -- or some other way of doing it.

Thanks for your help.
George
 
Hi George,

I did not use it, but there is a panel.horizontalalign if you place one
master panel with and place the others on that, tell that master that the
horizontalaling is horizontalalign.center and make the childs time by time
visible, than I expect it will have a greath look.

I am not compluete because as I told I never used it, however I expect it.

I hope this helps?

Cor
 
Back
Top