Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 101215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:43:42+00:00 2026-05-11T00:43:42+00:00

I have a C# app with a combo box. I was add items to

  • 0

I have a C# app with a combo box. I was add items to it in the usual way using a loop to loop through some objects and add each name property value to the combobox:

comboBox1.Items.Add(object.name); 

But then I decided I would like to display an image by the text, so I changed the drawMode and the dropDownStyle and set up an event handler on drawItem to draw first the image and then the text.

The image draws correctly, and then comes the problem. I am using something like

 e.Graphics.DrawString('What goes here?', e.Font, new SolidBrush(e.ForeColor), e.Bounds.Left,e.Bounds.Top); 

I cant get the object.name value into the DrawString parameter. Does the DrawItemEventArgs object e have the value, and if so how do I access it?

If it doesnt what are my real options? I have seem some examples that maintain a list to keep the values and then reference that using e.Index. Is this really the best way?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:43:43+00:00Added an answer on May 11, 2026 at 12:43 am

    It looks like the DrawItemEventArgs gives you the index. Use that index to index into comboBox1.Items.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that's a simple clone of reddit. Using Devise you can
I have a WinForms app. This app has a Preferences section where the user
Have an app that can use tts to read text messages. It can also
I have an app where the client will provide a list of pre-generated codes.
I have an app which uses two sliders to generate a product used elsewhere
I have an app (ASP.NET 3.5/ VS 2010) that works with a database project.
I have a web app that users upload files to. I want to authenticate
I have this code : private void vicationDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (zawag)
I have run into a problem where a couple of combos that are bound
Setting up a simple grails app with Dojo, i used the grails install-plugin dojo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.