From: Gladys on
Hi everybody, i have a problem creating a owner drawn ListBox.

I need a ListBox that accepts graphic icons (.ico) files between the text
(e.g. some text [myIcon.ico] more text and then another icon [myIcon.ico]
and some text )
So i I am assuming that this is only possible creating a owner drawn
ListBox.
I'm a beginner, so an simple example would be nice.

Thanks in advance,

Gladys


From: Toidy on
You might want to look at this

http://www.c-sharpcorner.com/UploadFile/vasu/OwnerDrawListBoxWithIcons11212005071009AM/OwnerDrawListBoxWithIcons.aspx

and

http://www.devx.com/dotnet/Article/8014/0/page/2

On Apr 4, 2:19 pm, "Gladys" <Gla...(a)nomail.nospam> wrote:
> Hi everybody, i have a problem creating a owner drawn ListBox.
>
> I need a ListBox that accepts graphic icons (.ico) files between the text
> (e.g.   some text [myIcon.ico] more text and then another icon [myIcon.ico]
> and some text  )
> So i I am assuming that this is only possible creating a owner drawn
> ListBox.
> I'm a beginner, so an simple example would be nice.
>
> Thanks in advance,
>
> Gladys

From: Gladys on
Toidy,

>You might want to look at this
>http://www.c-sharpcorner.com/UploadFile/vasu/OwnerDrawListBoxWithIcons11212005071009AM/OwnerDrawListBoxWithIcons.aspx

This example (I had already found this example) is still very
unclear/complicated to me.

My project has one listbox, three textboxes, a button and an imagelist with
one icon file.
The only thing i want to do (difficult enough for me) is add the text from
textbox1, textbox2 and textbox3 to the listbox, all text parts separted by
an icon from the imagelist.
I tried to adapt this example for my purpose, but it always failed.
I would appreciate a simpler example if possible.

http://www.devx.com/dotnet/Article/8014/0/page/2
This example seems to be VB.NET and not C#. (I had already found this
example also)

Thanks in advance,

Gladys


From: Jeff Johnson on
"Gladys" <Gladys(a)nomail.nospam> wrote in message
news:OZCQJvC1KHA.5996(a)TK2MSFTNGP05.phx.gbl...

> Hi everybody, i have a problem creating a owner drawn ListBox.
>
> I need a ListBox that accepts graphic icons (.ico) files between the text
> (e.g. some text [myIcon.ico] more text and then another icon
> [myIcon.ico] and some text )
> So i I am assuming that this is only possible creating a owner drawn
> ListBox.
> I'm a beginner, so an simple example would be nice.

My first question is "Do you have enough experience with the Graphics object
to draw what you want on, say, a PictureBox?" Because I'd say that's a
prerequisite for using OwnerDraw.


From: Peter Duniho on
Jeff Johnson wrote:
> My first question is "Do you have enough experience with the Graphics object
> to draw what you want on, say, a PictureBox?" Because I'd say that's a
> prerequisite for using OwnerDraw.

Agreed. With the minor nit to pick, that using a PictureBox as the base
implementation just for an arbitrary custom control is usually not
advantageous. Most custom controls should just inherit Control.

Pete