Solved

combobox item

Posted on 2006-11-13
4
319 Views
Last Modified: 2010-04-23
Hey guys

Is there anyway to change the text in a combobox  item when selected?  
ex.

Current combobox items
                                      Dog
                                      Cat
                                      xwife
when selected
                                      * Dog
                                      * Cat
                                      * xwife
Thanks
0
Comment
Question by:stephenz43
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Expert Comment

by:newyuppie
ID: 17935602
did you try handling it in the selecteditemchange() event of the combobox?
other questions: do you need the current selected item have an * or do you need the whole list to have *s? when do you need this to happen, right after you changed your selection, or when the combobox has input focus?
0
 

Author Comment

by:stephenz43
ID: 17935607
note...just adding a asterick(*) to the item when selected
0
 

Author Comment

by:stephenz43
ID: 17935614
it need to happen conditionaly.....depending on a series of calculations
0
 
LVL 6

Accepted Solution

by:
manch earned 500 total points
ID: 17935771

Try the following code it will surely work for u :

     
        'Inserting a New Item (with * preceeded in the text) in the Combo Box at the Index at which the item was selected
        ComboBox1.Items.Insert(ComboBox1.Items.IndexOf(ComboBox1.SelectedItem), "*" & ComboBox1.GetItemText(ComboBox1.SelectedItem))
       
        'Removing the Item Without *
        ComboBox1.Items.RemoveAt(ComboBox1.Items.IndexOf(ComboBox1.SelectedItem))

Try It
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question