자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 Q&A 이용 (제품 구매 고객 한정)

 

본 게시판은 개발자들이 자유롭게 질문과 답변을 공유하는 게시판입니다.
* 따라서 최대한 정중하게 질문을 올려 주세요.
* 질문을 상세히 작성해 주실 수록 좋은 답변이 올라 옵니다.
* 다른 분들도 참고할 수 있도록 결과 댓글 필수(또는 감사 댓글)
(결과 댓글을 달지 않는 경우 다음 질문에 대한 답변이 달리지 않는 불이익이 있을 수 있습니다.)
-----------------------------------------------------------------------------------------------

delphi 10.2 사용중인 초보입니다.

 

1. 멀티디바이스 프로그램에서 listboxitem에 사용자 정의 스타일을 집어 넣고

   FindStyleResource 로 대입한 내용이 스크롤을 움직이면 내용이 뒤죽박죽 됩니다.

  [스크롤하기전]

  스크롤하기전.PNG

[스크롤 내려갔다 올라옴]

스크롤내려갔다올라옴.PNG

 

2. StylesData['Text2Style'] 로 대입한 내용은 안바뀝니다. 

   TImage 나 TImageControl 의 Bitmap 에 StyleData[] 사용할때는 뭐라고 써야 하나요?

 

3. 뭔가 근본적인 방향이 잘못되었다면 지적 부탁드립니다.

 

 

... BeginUpdate/EndUpdate를 사용하면 listitem에 아무것도 안나옵니다.

... AddObject(listboxitem) 하면 전혀 다른 내용이 나옵니다.

 

 

style.PNG

 

procedure THeaderFooterForm.FormCreate(Sender: TObject);

var i:integer;

    lstitem : TListBoxItem;

    txt : TText;

    img : TImage;

begin

   listbox1.Items.Clear;

   for i:=0 to 9 do

   begin

      lstitem := TListBoxitem.Create(listbox1);

      lstitem.Parent := listbox1;

      lstitem.StyleLookup := 'listboxitemImage2';

 

      //스크롤해도 안바뀜

      lstitem.StylesData['Text2Style'] := inttostr(i);

 

      //스크롤하면 위치바뀜

      txt := lstitem.FindStyleResource('Text1Style') as TText;

      if assigned(txt) then

         txt.text := inttostr(i);

 

      img := lstitem.FindStyleResource('Image1Style') as TImage;

      if assigned(img) then

         img.bitmap.assign(TImageControl(self.FindComponent('img'+inttostr(i mod 3))).bitmap);

 

      img := lstitem.FindStyleResource('Image1Style2') as TImage;

      if assigned(img) then

         img.bitmap.assign(TImageControl(self.FindComponent('imgV'+inttostr((i mod 3)+1))).bitmap);

      lstitem.Height := 150;

   end;

 

 

   listbox2.Items.Clear;

   for i:=0 to 9 do

   begin

      lstitem := TListBoxitem.Create(listbox2);

      lstitem.Parent := listbox2;

      lstitem.StyleLookup := 'listboxitemImage1';

 

      //스크롤해도 안바뀜

      lstitem.StylesData['Text2Style'] := inttostr(i);

 

      //스크롤하면 위치바뀜

      txt := lstitem.FindStyleResource('Text1Style') as TText;

      if assigned(txt) then

         txt.text := inttostr(i);

 

      img := lstitem.FindStyleResource('Image1Style') as TImage;

      if assigned(img) then

         img.bitmap.assign(TImageControl(self.FindComponent('img'+inttostr(i mod 3))).bitmap);

      lstitem.Height := 150;

   end;

end;

번호 제목 글쓴이 날짜 조회 수
공지 [프로그래밍 강의] 2021.6~2021.12 관리자 2015.01.22 19434
공지 유용한 관련 사이트 관리자2 2014.03.20 58347
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 101853
739 FastReport 문의. [1] 회원 2015.10.12 1267
738 나침반 소스를 구하고 싶습니다. [1] songport 2014.12.01 1267
737 푸시기능 도움을 요청드립니다. [1] file 네임 2014.12.04 1267
736 [XE6] InApp 결제 개발 [1] 가을이다 2014.12.10 1267
735 [세미나] 사내 고객데이터와 연동이 가능한가요? [1] Humphery 2014.07.30 1269
734 데이터스냅에서 Record Type 전송하기 초보델파이 2014.06.25 1270
733 OCX등록 (주)머든 2015.02.14 1273
732 xe6 에서 rxlib 설치시 에러 메세지입니다 [1] 나빌레나 2014.12.23 1273
731 델파이 XE7에서 오라클 11G와 연결하는 법? [1] 밝은세상 2015.03.19 1274
730 [세미나] BaaS이용 시 비용은 얼마나 드나요? [1] Humphery 2014.07.30 1275
729 Fast Report에서 control 'Chart' has no parent 에서 발생 file 리노 2014.10.16 1276
728 아이폰 쪽 연동 부분에 에러 해결방안 문의 [1] file radio 2015.02.16 1278
727 RESTClient에서 POST가 안되요!!! [1] 카이로스 2016.01.27 1286
726 Rad Studio XE7 Trial 버전에서 안드로이드 연동 후 [1] file 다몽 2014.11.05 1287
725 캔들차트 [1] pky4437 2020.03.02 1288
724 구글플레이 자동업데이트 적용 방법 문의 [1] 사랑남 2015.04.24 1290
723 안드로이드 에뮬레이터 설정 방법을 문의 드립니다 [1] file 손보라 2018.07.05 1291
722 XE3 에서 무료로 사용 가능한 Report 툴이 있는지 알고 싶습니다. [2] 새벽공기 2015.01.14 1292
721 [공유] 엣지 브라우저 컴포넌트 설치 후 실행 시 "Failed to initialise Edge browser control" 오류가 발생합니다. [2] file 험프리 2020.09.28 1293
720 Delphi XE5 Professional ESD 문의 [1] GearFit 2014.11.06 1294