溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

VB.NET創(chuàng)建進(jìn)度條的方法

發(fā)布時間:2021-07-24 10:14:01 來源:億速云 閱讀:295 作者:chen 欄目:開發(fā)技術(shù)

本篇內(nèi)容主要講解“VB.NET創(chuàng)建進(jìn)度條的方法”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“VB.NET創(chuàng)建進(jìn)度條的方法”吧!

1.創(chuàng)建進(jìn)度條:

復(fù)制代碼 代碼如下:


<DIV id="Lay1" ><FONT face="宋體"></FONT><FONT face="宋體"></FONT><FONT face="宋體"></FONT><FONT face="宋體"></FONT><br>
<b><font color="#800080" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;正在檢索數(shù)據(jù),請稍候...</font></b>
<table align="center">
<tr>
<td>
<div ><span id="progress1">&nbsp;</span>
<span id="progress2">&nbsp;</span> <span id="progress3">&nbsp;</span> <span id="progress4">
&nbsp;</span> <span id="progress5">&nbsp;</span> <span id="progress6">&nbsp;</span>
<span id="progress7">&nbsp;</span> <span id="progress8">&nbsp;</span> <span id="progress9">
&nbsp;</span> <span id="progress10">&nbsp;</span> <span id="progress11">&nbsp;</span>
<span id="progress12">&nbsp;</span> <span id="progress13">&nbsp;</span><span id="progress14">&nbsp;</span><span id="progress15">&nbsp;</span>
</div>
</td>
</tr>
</table>
<script language="javascript">
var progressEnd = 15; // set to number of progress <span>'s.
var progressColor = 'blue'; // set to progress bar color
var progressInterval = 300; // set to time between updates (milli-seconds)
var progressAt = progressEnd;
var progressTimer;
function progress_clear() {
for (var i = 1; i <= progressEnd; i++) document.getElementById('progress'+i).style.backgroundColor = 'transparent';
progressAt = 0;
}
function progress_update() {
progressAt++;
if (progressAt > progressEnd) progress_clear();
else document.getElementById('progress'+progressAt).style.backgroundColor = progressColor;
progressTimer = setTimeout('progress_update()',progressInterval);
}
function progress_stop() {
clearTimeout(progressTimer);
progress_clear();
}
//progress_update(); // start progress bar
</script>
</DIV>


2.設(shè)置查詢按鈕屬性

復(fù)制代碼 代碼如下:


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此處放置初始化頁的用戶代碼
If Not IsPostBack The
but_find.Attributes.Add("onClick", "Lay1.style.visibility='';progress_update();")
End If
End Sub


3.注冊javascript腳本

復(fù)制代碼 代碼如下:


Public Sub scriptjdt(ByVal objPage As System.Web.UI.Page, ByVal strValue As String)
Dim jb As String
jb = "<script language='JavaScript'>" + strValue + "</script>"
objPage.RegisterStartupScript("jdt_ok", jb)
End Sub


4.在查詢按鈕單擊事件中調(diào)用

復(fù)制代碼 代碼如下:


Private Sub but_find_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles but_find.Click
'查詢數(shù)據(jù)代碼
'----------------
Me.scriptjdt(Me, "Lay1.style.visibility='hidden';progress_stop();") '關(guān)閉進(jìn)度條代碼
End Sub

到此,相信大家對“VB.NET創(chuàng)建進(jìn)度條的方法”有了更深的了解,不妨來實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI