1
我有兩個圖像圖標,基於某些條件,我希望將其中一個圖像的可見屬性設置爲false。例如,一個是箭頭圖像,另一個是文件夾圖像圖標。 將文件夾圖像圖標設置爲false時,箭頭圖像將代替文件夾圖像。如何避免圖像的移動?在隱藏圖像圖標的可見性時,相鄰圖像需要隱藏控件的x,y座標
設計頁面:
<td style="height:15px;padding-right:5px;width: 18px;vertical-align:top;">
<asp:LinkButton id="lnkDownload" runat="server">
<asp:Image ID="imgArrow" runat="server" ImageUrl="~/Images/DownloadIcon2.png" ToolTip="Download Item" style="vertical-align: middle;padding-bottom:0px;" Height="17px" Width="17px"/>
</asp:LinkButton>
</td>
<td style="height:15px;padding-right:5px;width: 18px;vertical-align:top;">
<asp:LinkButton id="lnkAddtoDownload" runat="server">
<asp:Image ID="imgfolder" runat="server" ImageUrl="~/Images/DownloadIcon1.png" ToolTip="Add to grid" style="vertical-align: middle;padding-bottom:0px;" Width="17px" Height="17px" />
</asp:LinkButton>
</td>
代碼背後
if(doc == weburl)
imgfolder.Visible = false;
附上了截屏。