Solved

combobox item

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now