StrataFrame Forum
Back
Login
Login
Home
»
Updates and Information
»
StrataFrame Users Contributed Samples
»
View images + Text in ComboBox
View images + Text in ComboBox
Post Reply
Like
2
View images + Text in ComboBox
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Mimouni Mohamed
Mimouni Mohamed
posted 11 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 0,
Visits: 50
Hello,
I try to
put images
+
text
in a
ComboBox.
I tried with
a
ComboBox
DrawItem
but it does
not
work
so I
searched the internet
and
I found this
code
:
Private Sub Ville_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.LIB_PAYS.DrawMode = DrawMode.OwnerDrawVariable
Me.LIB_PAYS.DropDownStyle = ComboBoxStyle.DropDownList
End Sub
Private Sub LIB_PAYS_DrawItem(sender As Object, e As System.Windows.Forms.DrawItemEventArgs) Handles LIB_PAYS.DrawItem
If e.Index <> -1 Then
e.Graphics.DrawImage(Me.ImageList1.Images(e.Index), e.Bounds.Left, e.Bounds.Top)
e.Graphics.DrawString(Me.LIB_PAYS.Items(e.Index).ToString, _
Me.LIB_PAYS.Font, _
System.Drawing.Brushes.Black, _
New RectangleF(e.Bounds.X + 15, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height))
e.DrawFocusRectangle()
End If
End Sub
I
know that
my
ComboBox
populated
with
BO
but it
still not working
so I
turn to you
to find out how
?
is what my
code
or code
that
I found
wrong?
Here is the
result that
shows
me
:
cordially
Mimouni
Reply
Like
2
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
View images + Text in ComboBox
Mimouni Mohamed
-
11 Years Ago
Doing owner draw overrides all of the formatting logic for the combo...
StrataFrame Team
-
11 Years Ago
Ben , thank you for the reply. I applied your solution, I...
Mimouni Mohamed
-
11 Years Ago
You're right, the IListSource.GetList() of the DataTable returns the...
StrataFrame Team
-
11 Years Ago
Think you very match ben
Mimouni Mohamed
-
11 Years Ago
Post Reply
Like
2
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search