Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi THTMLISTBOX Vertical align ? (https://www.delphipraxis.net/182410-delphi-thtmlistbox-vertical-align.html)

drama22 22. Okt 2014 07:12


Delphi THTMLISTBOX Vertical align ?
 
i want to show selected item and all other items in middle position i currently do this to center the item

Delphi-Quellcode:
<p align="center">' + item +
    '</p>'
thats centered it but how to get it in middle when Like vertical align

i tested vertical-align but did not work any suggestion ?

i tried to put it in <ul> Tag its kinda working but i dont need the dot beside the name i try to remove it as basic html like

Delphi-Quellcode:
'<ul><li type="none"><p align="center">' + item +
    '</p></li></ul><BR>'
but there is huge height between each item how to control on the item height ?

Volker Z. 22. Okt 2014 14:23

AW: Delphi THTMLISTBOX Vertical align ?
 
Hello,

Zitat:

[...] any suggestion ?
have you tried it with a blind (transparent) image?
  1. create a transparent gif or png (size 1 x 1 pixel)
  2. put a THTMListBox, TButton and a TPictureContainer component on a form
  3. add your transparent image to the picture container and rename it to "blind_1x1" (not really necessary)
  4. add an OnClick event to your button control
  5. try the following code:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  i : Integer;
  s : string;
begin
  for i := 0 to 6 do
    begin
      s := IntToStr (HTMListBox1.ItemHeight + 2 * (i + 1));
      HTMListBox1.Items.Add ('<p align="center"><img src="blind_1x1" width="1" height="' + s + '" align="middle">Test ' + s + '</p>')
    end
end;
Maybe it helps.

Greetings

drama22 22. Okt 2014 17:23

AW: Delphi THTMLISTBOX Vertical align ?
 
Zitat:

Zitat von Volker Z. (Beitrag 1277023)
Hello,

Zitat:

[...] any suggestion ?
have you tried it with a blind (transparent) image?
  1. create a transparent gif or png (size 1 x 1 pixel)
  2. put a THTMListBox, TButton and a TPictureContainer component on a form
  3. add your transparent image to the picture container and rename it to "blind_1x1" (not really necessary)
  4. add an OnClick event to your button control
  5. try the following code:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  i : Integer;
  s : string;
begin
  for i := 0 to 6 do
    begin
      s := IntToStr (HTMListBox1.ItemHeight + 2 * (i + 1));
      HTMListBox1.Items.Add ('<p align="center"><img src="blind_1x1" width="1" height="' + s + '" align="middle">Test ' + s + '</p>')
    end
end;
Maybe it helps.

Greetings


i dont know why THTMLISBOX does not load any image inside it i do as you said but its not working

Volker Z. 22. Okt 2014 17:36

AW: Delphi THTMLISTBOX Vertical align ?
 
Hello,

Zitat:

[...] i do as you said but its not working
is your PictureContainer property set (sorry, I forgot to mention)? Check it in the object inspector.

Greetings

drama22 22. Okt 2014 18:06

AW: Delphi THTMLISTBOX Vertical align ?
 
Zitat:

Zitat von Volker Z. (Beitrag 1277043)
Hello,

Zitat:

[...] i do as you said but its not working
is your PictureContainer property set (sorry, I forgot to mention)? Check it in the object inspector.

Greetings

oh yeah i got it i set picture container and added gif and jpeg and png in my uses Thanks it works but another thing why my animated image does not shows as animated ? in THTMLISTBOX i load the animated images from picture container


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:50 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz