Solved

combobox item

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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