心思世界's Archiver

tom1991 發表於 2008-10-1 08:48

ProgressBar ...??

我想試下用..但唔知要打咩指令??:onion099


用c#寫

cliff 發表於 2008-10-1 09:02

係 工具箱 搵 Progress Bar
C# 的 操作可以有
progressbar.Maximum = 100;
progressbar.Value = 0
do {
progressbar.Value += 1;
System.Threading.Thread.Sleep(500);
while(progressbar.Value < 100);

有其他東西加入請自行修改

tom1991 發表於 2008-10-1 09:30

[quote]原帖由 [i]cliff[/i] 於 2008-10-1 09:02 發表 [url=http://cnet.hk/bbs/redirect.php?goto=findpost&pid=588677&ptid=63308][img]http://cnet.hk/bbs/images/common/back.gif[/img][/url]
係 工具箱 搵 Progress Bar
C# 的 操作可以有
progressbar.Maximum = 100;
progressbar.Value = 0
do {
progressbar.Value += 1;
System.Threading.Thread.Sleep(500);
while(progressbar.Value < 100);

有 ... [/quote]如果我按"red",個progress要load...咁我應該係
private void radRed_Click(object sender, EventArgs e)
紅色radiobutton度打上面句語言 or 要其他地方打?



佢罵我...:onion080 :onion036

[[i] 本帖最後由 tom1991 於 2008-10-1 09:54 編輯 [/i]]

ivanyung 發表於 2008-10-1 09:55

:onion143C# ...
[quote]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ProgressBar
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;
            ProgStatus();
            button1.Enabled = true;
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                progressBar1.Value = 0;
                ProgStatus();
                radioButton1.Checked = false;
            };

        }

        private void ProgStatus()
        {
            progressBar1.Value = 0;
            do
            {
                progressBar1.Value += 1;
                System.Threading.Thread.Sleep(50);
            }
            while (progressBar1.Value < 100);
        }           

    }
}
[/quote]

tom1991 發表於 2008-10-1 09:58

回復 4# ivanyung 的帖子

咁長ge= =
e...用到啵,,我正想咁做.....

[[i] 本帖最後由 tom1991 於 2008-10-1 10:00 編輯 [/i]]

ivanyung 發表於 2008-10-1 10:01

[quote]原帖由 [i]tom1991[/i] 於 2008-10-1 09:58 發表 [url=http://www.cnet.hk/bbs/redirect.php?goto=findpost&pid=588748&ptid=63308][img]http://www.cnet.hk/bbs/images/common/back.gif[/img][/url]
咁長ge= = [/quote]
:onion126
唔係好長姐, 不過我唔識 C#, 用左 vb.net 的既念來寫, 可能可以簡單 d 掛, 要問 Cliff ...

cliff 發表於 2008-10-1 10:19

我估 tom 係想好似 download 個圖落黎, 之後再display進度

ivanyung 發表於 2008-10-1 10:29

用開 vb , 真係易好多 ... :onion126
[quote]
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button1.Enabled = False
        ProgBar()
        Button1.Enabled = True
    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        If RadioButton1.Checked = True Then
            ProgBar()
            RadioButton1.Checked = False
        End If
    End Sub

    Private Sub ProgBar()
        ProgressBar1.Value = 0
        Do
            ProgressBar1.Value = ProgressBar1.Value + 1
            System.Threading.Thread.Sleep(50)
            If ProgressBar1.Value = 100 Then Exit Do
        Loop
    End Sub

   
End Class

[/quote]

tom1991 發表於 2008-10-1 10:29

[quote]原帖由 [i]ivanyung[/i] 於 2008-10-1 09:55 發表 [url=http://cnet.hk/bbs/redirect.php?goto=findpost&pid=588745&ptid=63308][img]http://cnet.hk/bbs/images/common/back.gif[/img][/url]
:onion143C# ...
[/quote]用到了!再次感謝cliff 同 ivanyung 哥哥!

ivanyung 發表於 2008-10-1 10:33

[quote]原帖由 [i]cliff[/i] 於 2008-10-1 10:19 發表 [url=http://www.cnet.hk/bbs/redirect.php?goto=findpost&pid=588783&ptid=63308][img]http://www.cnet.hk/bbs/images/common/back.gif[/img][/url]
我估 tom 係想好似 download 個圖落黎, 之後再display進度 [/quote]
:onion126咁就有 d 難喎 ... 首先要知道個 file size ... 跟住要不斷 update download 了就多 bytes...

tom1991 發表於 2008-10-1 12:12

整完果個cool board...
岩岩整左個progressBar- -"(只是玩玩)
**** Hidden Message *****

ivanyung 發表於 2008-10-1 22:24

[quote]原帖由 [i]tom1991[/i] 於 2008-10-1 12:12 發表 [url=http://www.cnet.hk/bbs/redirect.php?goto=findpost&pid=588943&ptid=63308][img]http://www.cnet.hk/bbs/images/common/back.gif[/img][/url]
整完果個cool board...
岩岩整左個progressBar- -"(只是玩玩)
**** 本內容被作者隱藏 ***** [/quote]
好靚呀 ... 透明幾好睇 ... :onion067

tom1991 發表於 2008-10-1 22:25

[quote]原帖由 [i]ivanyung[/i] 於 2008-10-1 22:24 發表 [url=http://cnet.hk/bbs/redirect.php?goto=findpost&pid=589554&ptid=63308][img]http://cnet.hk/bbs/images/common/back.gif[/img][/url]

好靚呀 ... 透明幾好睇 ... :onion067 [/quote]好唔好玩呢~~~呵呵

ivanyung 發表於 2008-10-1 22:27

[quote]原帖由 [i]tom1991[/i] 於 2008-10-1 22:25 發表 [url=http://www.cnet.hk/bbs/redirect.php?goto=findpost&pid=589560&ptid=63308][img]http://www.cnet.hk/bbs/images/common/back.gif[/img][/url]
好唔好玩呢~~~呵呵 [/quote]
okay ... :onion004
不過我用緊部 notebook 好慢 ... 最後個 progressbar 整到我部機有小小 hang ... :onion089

tom1991 發表於 2008-10-1 22:33

[quote]原帖由 [i]ivanyung[/i] 於 2008-10-1 22:27 發表 [url=http://cnet.hk/bbs/redirect.php?goto=findpost&pid=589566&ptid=63308][img]http://cnet.hk/bbs/images/common/back.gif[/img][/url]

okay ... :onion004
不過我用緊部 notebook 好慢 ... 最後個 progressbar 整到我部機有小小 hang ... :onion089 [/quote]我果部電腦都有時hand...(load果條野)

頁: [1]
eXTReMe Tracker

Powered by Discuz! Archiver 6.1.0F  © 2001-2007 Comsenz Inc.