日期:2014-05-18  浏览次数:20881 次

急求啊 用c#制作的预览器中“前进”和“后退”的代码怎么写啊
初学者,所以不会,请各位会的教下,感激不尽

------解决方案--------------------
用javascript来实现
javascript:history.back(-1);是后退
javascript:history.go(1);是前进
------解决方案--------------------
<html>
<head>
<title>爱易网网页特效演示,前进后退按钮</title>
<style type="text/css">
<!--
body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }
 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>




<center><font color=red face="隶书" size=6>前进后退按钮</center>



<center>
<table border=5 bordercolor=blue borderlight=green>
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区</strong></td></tr>
<tr><td align=center><script language="VBScript">
<!--
Sub GoForward()
 form1.btn2.value="正在前进"
 history.go(1)
end sub

Sub GoBack()
 form1.btn1.value="正在后退"
 history.go(-1)
end sub
-->
</script>
<form name=form1>
<input type="button" name="btn1" value="<<后退" onClick="GoBack">
<input type="button" name="btn2" value="前进>>" onClick="GoForward">
</form>
</td></tr></table></center>




<center>
 <SCRIPT LANGUAGE="JavaScript">

<!-- hide

function goHist(a) 

{

history.go(a);

}

//-->

</script></center>




</body>
</html>
------解决方案--------------------
你可以模拟键盘按键
Alt+ ← 
Alt+ →
------解决方案--------------------
javascript:history.back(-1);是后退
javascript:history.go(1);是前进