자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 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 39525
공지 유용한 관련 사이트 관리자2 2014.03.20 79022
2432 XE8 사용자입니다... [1] 악마 2016.03.30 378
2431 질문] 코드사이트 중국어 표기 [1] 날개의꿈 2021.02.26 378
2430 한번에 개발하는 안드로이드 질문입니다. [2] file youngdel 2016.04.20 379
2429 FDQuery Sorting 하는 방법이 궁금합니다~ [1] 짧굵 2016.04.25 379
2428 listview를 DB와 livebind시 바인딩된 자료변화... [1] bursil 2017.11.13 379
2427 Tools > Options > Form Designer > Embedded designer 설정 기능이 없네요 [2] file 신현아빠 2018.01.26 379
2426 델파이 64비트에서 android:debuggable 옵션을 false 로 하는 방법 좀 가르쳐주세요. [1] 델파이_사랑 2019.12.16 379
2425 PushEvents1.StartupNotification 문의드립니다 [1] 최민철 2015.06.30 379
2424 모바일 기기 슬라이드 메뉴에 알람표시하기 [2] file 라드 2015.09.22 379
2423 [마이그레이션][델파이3>델파이10시애틀] ReadOnly에서 오류 납니다. [1] 박성민 2015.09.30 379
2422 [마이그레이션][팁] TServerSocket, TClientSocket 컴포넌트 추가 방법 험프리 2015.10.13 379
2421 아파치 RAD Server 연동 날개 2021.03.11 379
2420 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 11 - Exercise 3 [1] 관리자 2016.05.10 380
2419 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 12 - Exercise 7 [1] 관리자 2016.05.10 380
2418 ip4 주소형식을 ipv6 형식으로 변환하는 합수 없나요? kerry 2016.08.30 380
2417 Listview ScrollviewPos 위치 변경 버그인가요? silkroad99 2016.11.29 380
2416 멀티디바이스 기본 MasterDetail 템플릿에서 데이터들은 어디서 가져오나요? [2] Vincent 2017.09.22 380
2415 TButton에 TImage를 Child로 만들었는데.. [1] 미크 2018.05.16 380
2414 델파이 10.1 안드로이드용 앱푸시 알림관련 문의 경일 2018.06.22 380
2413 TMemo 및 다른 컴포넌트의 STyle지정 100jk 2019.01.23 380