Solved

combobox item

Posted on 2006-11-13
4
315 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
  • 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

772 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