자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 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 15781
공지 유용한 관련 사이트 관리자2 2014.03.20 54599
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 98018
» 멀티디바이스 프로그램에서 listboxitem에 사용자 정의 스타일 적용 문의 file agallee 2019.03.29 143
1772 TFDMemTable ios 에서 한글문제 있나요? [3] kerry 2015.10.28 143
1771 WebBrowser에서 메모리를 줄일수 있나요? kim 2015.12.11 143
1770 db 운영 시 데이터 추가 안되는현상 file 전수정 2017.05.29 144
1769 컴파일 할 때 더 깊이 들어가는 방법 [2] file 엽기토끼이요 2019.03.25 144
1768 TEdit를 반투명하게 입력을 받고싶습니다 헨씀히포 2019.12.01 144
1767 Datasanp FDQuery.Master/Details table Autoinc 필드사용에 대하여 file 넓다란세상 2020.03.31 144
1766 모바일 앱개발 기술지원요청 [2] 파란김치 2018.07.25 145
1765 TDataSetProvider 에 대해 문의합니다. [1] file 거북이 2015.10.05 145
1764 델파이 XE 디버깅시 매번 재컴파일 하나요? [1] 가나다 2019.03.14 146
1763 http server Result 한글 값 [2] 델마당쇠 2020.04.07 146
1762 XE5 겔럭시디바이스 연결 [2] file 넓다란세상 2019.06.24 147
1761 [10.3.3 브리핑] 파이어몽키 성능향상으로 어떤 것이 있었나요? 험프리 2019.12.05 147
1760 다시 글올립니다. dll 불러온 화면에서 탭키, 방향키가 작동이 안됩니다. 쭈니쿤 2016.04.29 147
1759 delphi dx 및 er stduio 설치후 기존 버전 문제 [1] voyager 2015.10.12 147
1758 설치 후 파이어몽키 데모 최초 실행시 오류 file 컴사랑 2019.02.25 148
1757 Delphi 10.2 Pointer, Byte 문의 [1] 엘트 2019.10.11 148
1756 [10.3.3 브리핑] 안드로이드 64비트 장비에서 실행이 안되요. 험프리 2019.12.05 148
1755 [마이그레이션][팁] 함수(또는 변수)에 빨간밑줄이 가고 컴파일 시 Undeclared Identifier 오류 시 조치방법 험프리 2015.10.12 148
1754 30392, iOS9 example WebBrowser 오류문의 [2] file 사랑남 2015.10.29 148