|
출력이 느릴 때, 가장 도움이 되는 방법은 각각의 Refresh 를 죽여 놓는 방법입니다.
Lines 프로퍼티에 BeginUpdate(), EndUpdate() 메소드가 있는데, 그리시기 전에 BeginUpdate()를 호출하시면, EndUpdate()가 나올때까지, 업데이트가 잠시 보류됩니다.
유지상 님이 쓰신 글 :
: 리스트박스를 하나 만들고, 그 리스트박스가 화면에 스트링을 나타낼 때에 스트링이 다 한 줄로 나오지 않고 '\n'에서는 다음 줄로 건너가도록 하기 위하여,
: 다음과 같이 짯습니다.
: 그런데, 이렇게 짜놓으니까, 리스트박스가 디스플레이되는데 좀 많이 버벅거리는 것 같던데, 즉, 좀더 무겁게 돌아가던데, 이 문제를 어떻게 해결해야될까요?
:
: __fastcall TForm1::TForm1(TComponent* Owner)
: : TForm(Owner)
: {
: this->Position = poDesktopCenter;
: ListBox1->Style = lbOwnerDrawVariable;
: ListBox1->MultiSelect = true;
: }
:
: void __fastcall TForm1::ListBox1DrawItem(TWinControl *Control, int Index,
: TRect &Rect, TOwnerDrawState State)
: {
: //TODO :
: TListBox* Lst = (TListBox*)Control;
:
: DrawText(Lst->Canvas->Handle, Lst->Items->Strings[Index].c_str(),-1,&Rect,DT_WORDBREAK);
: }
: //---------------------------------------------------------------------------
:
: void __fastcall TForm1::ListBox1MeasureItem(TWinControl *Control,
: int Index, int &Height)
: {
: //TODO :
: TListBox* Lst = (TListBox*)Control;
: TRect rect = Lst->ItemRect(Index);
:
: DrawText(Lst->Canvas->Handle, Lst->Items->Strings[Index].c_str(),-1,&rect,DT_CALCRECT|DT_WORDBREAK);
: Height = rect.Height();
: }
:
:
|