2、定义3个Panel,用于实现窗体拖动效果,代码如下:
1
<body>
2
<form id="form1" runat="server">
3
<div>
4
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
5
</cc1:ToolkitScriptManager>
6
7
</div>
8
<div style=" 292px; height: 318px">
9
<asp:Panel ID="Panel3" runat="server" Height="50px" Width="125px">
10
<asp:Panel ID="Panel1" runat="server" Height="27px" Width="292px" BackColor="ActiveBorder" BorderWidth="1px">
11
鼠标拖动区域</asp:Panel>
12
<asp:Panel ID="Panel2" runat="server" Height="274px" Width="291px" Style="overflow: scroll" BorderColor="Black" BorderWidth="1px">
13
演示web拖动桌面窗体</asp:Panel>
14
</asp:Panel>
15
</div>
16
<cc1:DragPanelExtender ID="DragPanelExtender1" runat="server" TargetControlID="Panel3">
17
</cc1:DragPanelExtender>
18
</form>
19
</body>
并且将DragPanelExtender控件拖至页面中,使其TargetControlID="Panel3",指定要拖动的区域的Panel,如本例中的Panel3.

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19
