자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 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 15804
공지 유용한 관련 사이트 관리자2 2014.03.20 54605
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 98045
2839 앱 ClientDataSet Active 에러 [1] file 사랑남 2015.09.03 141
2838 실행시 다중폼에서 리소스에 의한 잔상(?) 문제 포세가이 2019.03.15 141
2837 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 21 - Exercise 1 [1] 관리자 2016.05.27 141
2836 TButton에 TImage를 Child로 만들었는데.. [1] 미크 2018.05.16 141
2835 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 11 - Exercise 7 [1] 관리자 2016.05.10 142
2834 FMX List View의 Toggle DesignMode 자동크기 조절에 대해 질문드립니다. [1] file syc 2017.04.18 142
2833 1개의 실행파일에 유닛(폼)을 몇개까지 담을수 있나요 ? 노력하는삶 2020.05.07 142
2832 델파이 5.0 스페인어 Richtext box 깨어지는 문제해결 방법? [1] file 여호수아 2018.06.19 142
2831 FireDAC - TFDLocalSQL 문의드립니다. [2] 딤몽 2020.11.19 142
2830 [베를린 웨비나] FireUI Preview 설치 설명을 나중에 게시판 통해서 조금 보강해 주시면 좋겠습니다. 험프리 2016.05.04 143
2829 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 13 - Exercise 8 [1] 관리자 2016.05.10 143
2828 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 20 - Exercise 1 [1] file 관리자 2016.05.27 143
» 멀티디바이스 프로그램에서 listboxitem에 사용자 정의 스타일 적용 문의 file agallee 2019.03.29 143
2826 문의 드립니다. [1] 너이쉐이홧팅 2015.06.02 143
2825 TFDMemTable ios 에서 한글문제 있나요? [3] kerry 2015.10.28 143
2824 브레이크가 걸리지 않네요 [1] LEO 2017.02.24 143
2823 WebBrowser에서 메모리를 줄일수 있나요? kim 2015.12.11 143
2822 ListBox 사용중 문의 드립니다. [2] file 오광 2015.09.09 144
2821 델파이 안드로이드 에서 사이즈 질문 [1] 루피 2016.11.12 144
2820 db 운영 시 데이터 추가 안되는현상 file 전수정 2017.05.29 144