[問題] 關於MFC~ button和Listbox的問題
看板C_and_CPP (C/C++)作者kevinimpreza (天鵝絨的幽闇)時間16年前 (2009/11/21 00:42)推噓0(0推 0噓 2→)留言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
11/21 00:43, 1F
→
11/21 01:11, , 2F
11/21 01:11, 2F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章