面板上的图像不能水平滚动 [英] Image on panel not scroll horizontal
本文介绍了面板上的图像不能水平滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
不使用数据列表的解决方案,面板内的图像按钮不滚动;剩下的图像按钮不可见
a solution without using datalists, imagebuttons inside the panel do not scroll; and the remaining imagebuttons are not visible
public void CreateImage()
{
ImageButton[] myImage = new ImageButton[11];
Panel myPanel = (Panel)Page.FindControl("pnlDia1");
for (int i = 0; i < 10; i++)
{
myImage[i] = new ImageButton();
myImage[i].Height = 130;
myImage[i].Style.Add("Cursor", "pointer");
myImage[i].ImageUrl = "~/Images/File_-109.jpg";
pnlDia1.Controls.Add(myImage[i]);
}
我的尝试:
What I have tried:
<div style="overflow-x:auto; height:150px; overflow-y:hidden">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" Visible="true">
<ContentTemplate>
<asp:Panel ID="pnlDia1" runat="server" ScrollBar="Horizontal">
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</div>
推荐答案
解决了
添加表结构< br $>
Solved
adding a Table structure
<asp:UpdatePanel ID="UpdatePanel2" runat="server" Visible="true">
<ContentTemplate>
<asp:Panel ID="pnlDia1" runat="server">
<asp:Table ID="Table1" runat="server">
<asp:TableRow>
<asp:TableCell>
.............
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
这篇关于面板上的图像不能水平滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文