Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT picturebox in listbox

Status
Not open for further replies.

sal21

Programmer
Apr 26, 2004
425
IT
With Me.List1
.AddItem PadC("STABILIMANTO BALNEARE ARCOBALENO SRL", LARGHEZZA) '1
.AddItem PadC("VIALE MEDITERRANEO, 145", LARGHEZZA) '3
.AddItem PadC("84017 POSITANO (SA)", LARGHEZZA) '4
.AddItem PadC("TEL. 0894258987", LARGHEZZA) '5
.AddItem "" '6
.AddItem PadC("DOCUMENTO COMMERCIALE DI VENDITA O PRESTAZIONE", LARGHEZZA) '1
.AddItem ""
End With

under, .AddItem "", possible to insert a picturebox with image, naturally center based the width of lisbox...

but in effect i need to add a EAN code, under .AddItem ""

other way are welcome.

see image, the code to trnsform in Ean, is the numeric value, in image (actually i store this value in a string var named EAN_CODE.

Link

Note:
i dont know wath is the real code and type of EAN, sorry
 
... and the reason to display barcodes in a listbox on VB6 form would be... [ponder]

SCO_1_pzkc5y.jpg


---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
is the last value in a recepit(ticket) of a store

in effect i loop a item in listbox, and sent to printer
 
Can't you just OCR the images and take the last line - 16 digits number - from it?

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Andy,
is the other solution?
if yes how to?
 
I did mention before the use of [tt]MSFlexGrid[/tt]. You can use it to display pictures: [wiggle]

My picture:
A_Picture_z6xg5m.jpg


Grid_fd6mgb.png


Code:
Option Explicit

Private Sub cmdShowPicture_Click()

With Me.MSFlexGrid1
    .FormatString = "<Text |<Picture"[green]
    '.ColWidth(1) = 2000[/green]
    .RowHeight(1) = 800
    .Row = 1
    .Col = 0
    .Text = "My text"
    .Col = 1[green]
    '.CellAlignment = flexAlignLeftCenter 'align text left
    '.Text = "Hello World"[/green]
    Set .CellPicture = LoadPicture("[red]C:\TEMP\A_Picture.jpg[/red]") [green]'picture is 42*40 pixels[/green]
    .CellPictureAlignment = flexAlignCenterCenter
    .ColWidth(0) = .Width / 2 - 50
    .ColWidth(1) = .Width / 2 - 50
End With

End Sub


---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
>possible to insert a picturebox with image

Not with a VB listbox, no.

As Andy suggests, you need to consider other controls. Pretty sure you already know how to do pictures in an MSFlexgrid, for example
 
strongm, how about, richrextbox?
i can change, listbox to richrextbox, in my Project, now
 
It might be a good idea - given we have already covered EAN in a listview for you (thread222-1809066) - if perhaps you can explain what you are trying to achieve, rather than you randomly naming additional controls, and then maybe we can advise on what we think is the best way of achieving your goal.
 
[tt]ListBox[/tt] allows you to 'list' items so you can select one, two, or many items from it.
And how would the [tt]RichTextBox[/tt] do the job of a [tt]ListBox[/tt] [ponder]

Maybe we all are going all wrong here. Please, answer strongm's question.

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top