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

Panel and ASP.NET

Hi,
There is any chance to insert a control like a text box
in a panel choosing the absolute position?
When I try to insert a label , the panel positions the
control on a locked position.
Thanks
Fabrizio
Nov 15 '05 #1
3 10808
Hi Fabrizio,

The Panel web control is translated to a DIV tag, now you will need to set
the Label.Style accordly , I don't recall the exact property you have to
set, but most possible will be set the positioning to relative and set the
topX and topY

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Fabrizio" <fm******@libero.it> wrote in message
news:01****************************@phx.gbl...
Hi,
There is any chance to insert a control like a text box
in a panel choosing the absolute position?
When I try to insert a label , the panel positions the
control on a locked position.
Thanks
Fabrizio

Nov 15 '05 #2
I just toyed around with it a little. The only way I was able to set an
absolute positon for a textbox in a panel is to go to HTML view and add a
style attribute to the HTML text by hand. You can copy it from the panel
statement easily and modify. If you then return to design mode and try to
move the textbox by hand the manually added position values get dropped by
the IDE. So leave the controls alone once you set the position inside HTML.
You can accomplish what you wanted to do, but not at the efficiency you are
looking for. You will loose the ability to make corrections to the positions
in the design view. Though you are able to move the panel around and retain
the position of the textbox within the panel just fine which is good.

VS really has a limitation once you drop a control into a panel and you have
to either live with only a flow layout mode or manually change the HTML.
Also after you added a control and manually added a style attribute and set
the TOP/LEFT position, any future dragged/dropped controls into the panel
are added in flow layout style but with a gap since VS did not notice that
we manually the prior control manually away from its initial flow controlled
position.

Here's a quick example for a textbox that you dragged/dropped inside a
panel:

Change: <asp:TextBox id="TextBox1" runat="server">
To: <asp:TextBox id="TextBox1" style="LEFT: 50px; POSITION:
absolute; TOP: 50px" runat="server">

Then you play around with the LEFT/TOP values to adjust the position within
the panel. The absolute reference seems to apply to within the bounds of the
panel and not the position in the complete browser space btw.
Hope this helps

Robert Sentgerath

"Fabrizio" <fm******@libero.it> wrote in message
news:01****************************@phx.gbl...
Hi,
There is any chance to insert a control like a text box
in a panel choosing the absolute position?
When I try to insert a label , the panel positions the
control on a locked position.
Thanks
Fabrizio

Nov 15 '05 #3
If you want to be able to move a control embedded in a panel, change the
flow mode in the panel attribute
ms_positioning="GridLayout". The panel will now contain a grid allowing
adjustment of controls embedded in it. Panels default to "FlowLayout". You
make this change from html inside the html page at the tag pointed to by
Panel. Similarly, you can change any control which supports this to either
flow or grid layout.
--
Regards,
Alvin Bruney
Got DotNet? Get it here...
http://www.networkip.net/dotnet/tidbits/default.htm
"rsentgerath" <Se*****@bellsouth.net> wrote in message
news:ug**************@TK2MSFTNGP09.phx.gbl...
I just toyed around with it a little. The only way I was able to set an
absolute positon for a textbox in a panel is to go to HTML view and add a
style attribute to the HTML text by hand. You can copy it from the panel
statement easily and modify. If you then return to design mode and try to
move the textbox by hand the manually added position values get dropped by
the IDE. So leave the controls alone once you set the position inside HTML. You can accomplish what you wanted to do, but not at the efficiency you are looking for. You will loose the ability to make corrections to the positions in the design view. Though you are able to move the panel around and retain the position of the textbox within the panel just fine which is good.

VS really has a limitation once you drop a control into a panel and you have to either live with only a flow layout mode or manually change the HTML.
Also after you added a control and manually added a style attribute and set the TOP/LEFT position, any future dragged/dropped controls into the panel
are added in flow layout style but with a gap since VS did not notice that
we manually the prior control manually away from its initial flow controlled position.

Here's a quick example for a textbox that you dragged/dropped inside a
panel:

Change: <asp:TextBox id="TextBox1" runat="server">
To: <asp:TextBox id="TextBox1" style="LEFT: 50px; POSITION:
absolute; TOP: 50px" runat="server">

Then you play around with the LEFT/TOP values to adjust the position within the panel. The absolute reference seems to apply to within the bounds of the panel and not the position in the complete browser space btw.
Hope this helps

Robert Sentgerath

"Fabrizio" <fm******@libero.it> wrote in message
news:01****************************@phx.gbl...
Hi,
There is any chance to insert a control like a text box
in a panel choosing the absolute position?
When I try to insert a label , the panel positions the
control on a locked position.
Thanks
Fabrizio


Nov 15 '05 #4

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

Similar topics

9
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
2
by: Peteroid | last post by:
When the application I'm working on is run it creates a panel with a Paint event customized to draw primitives (circles, rectangles, etc.), places the panel on a form, and then launches the form....
1
by: clintonG | last post by:
I'm having a problem maintaining state with a Panel control in a MasterPage and I need help thinking through this process. The basic structure of the HTML in the Master looks like this... ...
3
by: John Salerno | last post by:
I'm using the sample code of the file 'simple.py' and trying to make a single window with a panel in it, but I keep getting an error. Here's my code: (I know I might need something else, like a...
10
by: markwalker84 | last post by:
Hello everyone! Got a bit of a problem... Two of the panels on my program contain a number of check boxes. The exact number of which is determined by a pair of variables. I have recently...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
11
by: dongarbage | last post by:
Hi there, I'm very much a C# novice. How do you do freehand drawing on a panel with a mouse in c#? Thanks, Don
3
by: zhaodapu | last post by:
I derived a panel class: public class DeskPanel : System.Windows.Forms.Panel Now I want to use the visual designer to add controls in MyPanel class. But I noticed that the visual designer...
3
by: Gandalf | last post by:
why when I try to insert gridSizer to a panel which already inside another panel the gridSizer doesn't work? this is the code: panel3= wx.Panel(self, -1, (0, 60), size=(400, 240) ,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.