자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 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 15769
공지 유용한 관련 사이트 관리자2 2014.03.20 54583
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 98004
739 Application Loader를 이용하여 ipa등록시 에러 [2] file 사랑남 2015.01.14 1235
738 [마이그레이션] 델파이 XE8에서 체크박스, 라디오버튼의 글자의 색상을 변경하고 싶어요. 험프리 2015.06.10 1240
737 OCX등록 (주)머든 2015.02.14 1242
736 푸시기능 도움을 요청드립니다. [1] file 네임 2014.12.04 1248
735 나침반 소스를 구하고 싶습니다. [1] songport 2014.12.01 1249
734 RESTClient에서 POST가 안되요!!! [1] 카이로스 2016.01.27 1250
733 델파이 XE7에서 오라클 11G와 연결하는 법? [1] 밝은세상 2015.03.19 1252
732 Showmodal 시 Cannot make a visible window modal 오류 발생 [1] file 신현아빠 2017.11.21 1253
731 안드로이드 에뮬레이터 설정 방법을 문의 드립니다 [1] file 손보라 2018.07.05 1253
730 데이터스냅에서 Record Type 전송하기 초보델파이 2014.06.25 1258
729 [XE6] InApp 결제 개발 [1] 가을이다 2014.12.10 1258
728 [세미나] BaaS이용 시 비용은 얼마나 드나요? [1] Humphery 2014.07.30 1259
727 xe6 에서 rxlib 설치시 에러 메세지입니다 [1] 나빌레나 2014.12.23 1261
726 시리얼 통신 질문 드립니다. [3] 뮤뮤 2020.07.21 1262
725 Fast Report에서 control 'Chart' has no parent 에서 발생 file 리노 2014.10.16 1262
724 [세미나] 사내 고객데이터와 연동이 가능한가요? [1] Humphery 2014.07.30 1263
723 ADOQuery Insert 후 Refresh 할 수 있나요?? [6] 초보델팡이 2019.05.20 1265
722 아이폰 쪽 연동 부분에 에러 해결방안 문의 [1] file radio 2015.02.16 1267
721 Rad Studio XE7 Trial 버전에서 안드로이드 연동 후 [1] file 다몽 2014.11.05 1268
720 [질문] 이미지를 datasnap을 사용하여 서버로 전송밥법 [2] 화현 2021.08.08 1268