Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
See pages that link to and include this page.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).
Notify administrators if there is objectionable content in this page.
Something does not work as expected? Find out what you can do.
General Wikidot.com documentation and help section.
Wikidot.com Terms of Service - what you can, what you should not etc.
Wikidot.com Privacy Policy.
老師您好~
我是C#新手, 所以有很多命令寫法仍不熟悉, 我在網路上也試圖找許多寫法但仍未成功, 所以想在此請教您一個問題, 可否請您給一些建議, 謝謝!!
我在程式運行當中想隨時偵測button_Stop 是否被觸發, 我現在使用的程式碼是 :Application.DoEvents();
雖然程式可以運行, 卻仍想試試看是否有其他寫法可行, 不知道老師是否可以給我一點建議, 如能回覆, 非常感謝!!
public partial class Form1:Form
{
private void button_Start_Click(object sender, EventArgs e)//開始測試
{
REG.PMBus_Verify();
}
public void button_Stop_Click(object sender, EventArgs e)//暫停測試
{
ATS_TEST.STOP_FLAG = true;
}
}
class PMBus_Reg
{
public void PMBus_Verify()
{
SEQ_Result = Run_REG();
}
public bool Run_REG()
{
Application.DoEvents(); // 偵測button_Stop_Click是否被觸發
// 以下都是程式碼
}
}
public partial class Form1:Form
{
bool isButtonStarted = false;
private void button_Start_Click(object sender, EventArgs e)//開始測試
{
isButtonStarted = true;
}
public void button_Stop_Click(object sender, EventArgs e)//暫停測試
{
isButtonStarted = false;
}
}
你好, 由於是測試軟體, 有需要到中途暫停, 輸入條碼…等功能, 所以無法把所有相關的測試程式碼全部寫在 button_Start 裡, 只能把程式一支支拆掉(測試項目太多)
你的程式碼 bool isButtonStarted = false; 我也有寫, 只是沒寫在網路上, 但這方式無法在中途偵測到button_Stop被觸發, 而是等到測試完才觸發此按鈕, 這樣完全就失去時效性了。還是謝謝你的回覆!!
这种免费的不多见了。
可以单独列一个页面出来讨论而不是全部集中在主页面中的讨论区,可以参考wikidot中流行的各种的小说网站的讨论模式。
Post preview:
Close preview