[問題] 關於MFC~ button和Listbox的問題

看板C_and_CPP (C/C++)作者 (天鵝絨的幽闇)時間16年前 (2009/11/21 00:42), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/2 (看更多)
請教一下關於MFC的問題 我想設計一個能夠按下button後無限的在ListBox顯示字串"#" 再按一次button就可以暫停顯示 再按一次button就恢復無限顯示字串"#" 這樣的視窗程式 以下是我的程式碼~ //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { char *s="#"; while(TRUE) { ListBox1->Items->Add(s); } } //--------------------------------------------------------------------------- 但不知為何就是無法成功 懇請大大指教~ 非常感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.25.118.136

11/21 00:43, , 1F
我是用Borland C++ Builder寫的 抱歉忘了說
11/21 00:43, 1F

11/21 01:11, , 2F
這不是mfc吧。 用timer或thread來控制比較快
11/21 01:11, 2F
文章代碼(AID): #1B1iRlo3 (C_and_CPP)
文章代碼(AID): #1B1iRlo3 (C_and_CPP)