Filling the Web page with a splitter

来源:互联网 发布:java数组与集合的区别 编辑:程序博客网 时间:2024/06/09 06:37
To create the feel of a desktop application, you may want to have a splitter control fill the entire Web page. To
do this, you must obviously set the Widthand Heightproperties of the splitter to "100%". However, if you just
set those properties and run your application, you may encounter some unexpected behavior. For example, you
may find the splitter with a height of 0!
To achieve the expected behavior, you need to make some changes to the tags that Visual Studio automatically
adds to the aspx file:
1. On the <html>tag, set the styleattribute to give the document a height of 100%:
style="height:100%".
2. On the <body>tag, you must again set the styleattribute to include a height of 100%. In addition, the
style attribute must reset the margin. The default margin of the body is 5 pixels, and you will want to
change this to 0. Optionally, you may also want to remove the page scroll bars for a more desktop-like
feel. Putting these changes together gives the tag:
<body style="height:100%;margin:0px" scroll="no">
3. Any elements that contain the splitter must also have their height set to 100% and their margin set to 0.
This includes the <form>tag:
<form id="form1" runat="server" style="height:100%;margin:0px">
原创粉丝点击