|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to delete a ComboBox itemI have a usercontrol that inherits from ComboBox
I'd like to add the feature that the user can delete any item Best would be that he could right click an element and a messagebox would ask if he wanted to delete that element I can't find an event that would enable me to do that. I could copy the items into a text box, let him edit it and put them back Not to fond of that Got any other idea of how it might be done?? Thanks Franky,
It is very important to answer you in that how your combobox is populated. One of the meanings of combo is that you can do it from a datasource and from an inbuild array. Cor Show quoteHide quote " Franky" <frankieNOSPAM@a-znet.com> schreef in bericht news:%236ckWxoFHHA.5004@TK2MSFTNGP03.phx.gbl... >I have a usercontrol that inherits from ComboBox > > I'd like to add the feature that the user can delete any item > > Best would be that he could right click an element and a messagebox would > ask if he wanted to delete that element > > I can't find an event that would enable me to do that. > > I could copy the items into a text box, let him edit it and put them back > > Not to fond of that > > Got any other idea of how it might be done?? > > > Thanks > Morning Cor ,
How are you doing ? Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:%231uMxFqFHHA.536@TK2MSFTNGP02.phx.gbl... > Franky, > > It is very important to answer you in that how your combobox is populated. > One of the meanings of combo is that you can do it from a datasource and > from an inbuild array. > > Cor > > " Franky" <frankieNOSPAM@a-znet.com> schreef in bericht > news:%236ckWxoFHHA.5004@TK2MSFTNGP03.phx.gbl... >>I have a usercontrol that inherits from ComboBox >> >> I'd like to add the feature that the user can delete any item >> >> Best would be that he could right click an element and a messagebox would >> ask if he wanted to delete that element >> >> I can't find an event that would enable me to do that. >> >> I could copy the items into a text box, let him edit it and put them back >> >> Not to fond of that >> >> Got any other idea of how it might be done?? >> >> >> Thanks >> > > Missed you a while saw your previous message, are you going to be again
active here? Cor Show quoteHide quote "OHM" <lkjhlkj> schreef in bericht news:exKG%23QrFHHA.3616@TK2MSFTNGP06.phx.gbl... > Morning Cor , > > How are you doing ? > > "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message > news:%231uMxFqFHHA.536@TK2MSFTNGP02.phx.gbl... >> Franky, >> >> It is very important to answer you in that how your combobox is >> populated. One of the meanings of combo is that you can do it from a >> datasource and from an inbuild array. >> >> Cor >> >> " Franky" <frankieNOSPAM@a-znet.com> schreef in bericht >> news:%236ckWxoFHHA.5004@TK2MSFTNGP03.phx.gbl... >>>I have a usercontrol that inherits from ComboBox >>> >>> I'd like to add the feature that the user can delete any item >>> >>> Best would be that he could right click an element and a messagebox >>> would ask if he wanted to delete that element >>> >>> I can't find an event that would enable me to do that. >>> >>> I could copy the items into a text box, let him edit it and put them >>> back >>> >>> Not to fond of that >>> >>> Got any other idea of how it might be done?? >>> >>> >>> Thanks >>> >> >> > > I'm going to try, but I've been incredibly busy with commerical work so I'll
probably be contributing in little bursts. Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:%23e5jQ7rFHHA.4712@TK2MSFTNGP04.phx.gbl... > Missed you a while saw your previous message, are you going to be again > active here? > > Cor > > "OHM" <lkjhlkj> schreef in bericht > news:exKG%23QrFHHA.3616@TK2MSFTNGP06.phx.gbl... >> Morning Cor , >> >> How are you doing ? >> >> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message >> news:%231uMxFqFHHA.536@TK2MSFTNGP02.phx.gbl... >>> Franky, >>> >>> It is very important to answer you in that how your combobox is >>> populated. One of the meanings of combo is that you can do it from a >>> datasource and from an inbuild array. >>> >>> Cor >>> >>> " Franky" <frankieNOSPAM@a-znet.com> schreef in bericht >>> news:%236ckWxoFHHA.5004@TK2MSFTNGP03.phx.gbl... >>>>I have a usercontrol that inherits from ComboBox >>>> >>>> I'd like to add the feature that the user can delete any item >>>> >>>> Best would be that he could right click an element and a messagebox >>>> would ask if he wanted to delete that element >>>> >>>> I can't find an event that would enable me to do that. >>>> >>>> I could copy the items into a text box, let him edit it and put them >>>> back >>>> >>>> Not to fond of that >>>> >>>> Got any other idea of how it might be done?? >>>> >>>> >>>> Thanks >>>> >>> >>> >> >> > > Populated from things the user previously typed into the ComboBox's Text box
Thanks for the interest Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:%231uMxFqFHHA.536@TK2MSFTNGP02.phx.gbl... > Franky, > > It is very important to answer you in that how your combobox is populated. > One of the meanings of combo is that you can do it from a datasource and > from an inbuild array. > > Cor > > " Franky" <frankieNOSPAM@a-znet.com> schreef in bericht > news:%236ckWxoFHHA.5004@TK2MSFTNGP03.phx.gbl... >>I have a usercontrol that inherits from ComboBox >> >> I'd like to add the feature that the user can delete any item >> >> Best would be that he could right click an element and a messagebox would >> ask if he wanted to delete that element >> >> I can't find an event that would enable me to do that. >> >> I could copy the items into a text box, let him edit it and put them back >> >> Not to fond of that >> >> Got any other idea of how it might be done?? >> >> >> Thanks >> > > Franky,
Than you can just find the index with findstringexact and remove the index. Cor Show quoteHide quote " Franky" <frankieNOSPAM@a-znet.com> schreef in bericht news:OOsFXOuFHHA.3668@TK2MSFTNGP02.phx.gbl... > Populated from things the user previously typed into the ComboBox's Text > box > > Thanks for the interest > > > > > > > "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message > news:%231uMxFqFHHA.536@TK2MSFTNGP02.phx.gbl... >> Franky, >> >> It is very important to answer you in that how your combobox is >> populated. One of the meanings of combo is that you can do it from a >> datasource and from an inbuild array. >> >> Cor >> >> " Franky" <frankieNOSPAM@a-znet.com> schreef in bericht >> news:%236ckWxoFHHA.5004@TK2MSFTNGP03.phx.gbl... >>>I have a usercontrol that inherits from ComboBox >>> >>> I'd like to add the feature that the user can delete any item >>> >>> Best would be that he could right click an element and a messagebox >>> would ask if he wanted to delete that element >>> >>> I can't find an event that would enable me to do that. >>> >>> I could copy the items into a text box, let him edit it and put them >>> back >>> >>> Not to fond of that >>> >>> Got any other idea of how it might be done?? >>> >>> >>> Thanks >>> >> >> > > Cor
This is more a design question rather that an implementation question. I know how to delete items. I can't think of a neat way for the user to select the items to be deleted. One possibility is for the user to click an item so that it appears in the text box, and the button might say "Delete item showing in Textbox" It just occurred to me that the items might be able to display a checkbox next to them - is that possible in a combobox -I'll have to check. If that is possible the user could check the items to be deleted while the dropdown list is showing. A quick test led me to believe Combobox gets a click event if I click in the textbox or cause a dropdown. It does not get one if I click and item in the dropdown. Maybe in WndProc I could catch the right click and figure out which item the user clicked. Does that seem like a way to go??? .... >>>>I have a usercontrol that inherits from ComboBox ....>>>> >>>> I'd like to add the feature that the user can delete any item >>>> >>>> Best would be that he could right click an element and a messagebox >>>> would ask if he wanted to delete that element >>>> >>>> I can't find an event that would enable me to do that. >>>> >>>> I could copy the items into a text box, let him edit it and put them >>>> back >>>> Franky,
Why you don't simple drag a contextmenustrip on your form Set the first menu Set that as property in the combobox And you are almost ready, Cor Show quoteHide quote " Franky" <frankieNOSPAM@a-znet.com> schreef in bericht news:ejoKw8uFHHA.2296@TK2MSFTNGP04.phx.gbl... > Cor > > This is more a design question rather that an implementation question. > > I know how to delete items. > > I can't think of a neat way for the user to select the items to be > deleted. > > One possibility is for the user to click an item so that it appears in the > text box, and the button might say "Delete item showing in Textbox" > > It just occurred to me that the items might be able to display a checkbox > next to them - is that possible in a combobox -I'll have to check. If that > is possible the user could check the items to be deleted while the > dropdown list is showing. > > A quick test led me to believe Combobox gets a click event if I click in > the textbox or cause a dropdown. It does not get one if I click and item > in the dropdown. > > Maybe in WndProc I could catch the right click and figure out which item > the user clicked. Does that seem like a way to go??? > > > ... > > > >>>>>I have a usercontrol that inherits from ComboBox >>>>> >>>>> I'd like to add the feature that the user can delete any item >>>>> >>>>> Best would be that he could right click an element and a messagebox >>>>> would ask if he wanted to delete that element >>>>> >>>>> I can't find an event that would enable me to do that. >>>>> >>>>> I could copy the items into a text box, let him edit it and put them >>>>> back >>>>> > > ... > Cor
In Opening I built a contextmenustrip that has items like Delete EXE Delete TXT The items in the combobox being EXE and TXT Clicking one deletes it Very nice Thanks Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:OKtTRKvFHHA.536@TK2MSFTNGP02.phx.gbl... > Franky, > > Why you don't simple drag a contextmenustrip on your form > Set the first menu > Set that as property in the combobox > > And you are almost ready, > > Cor > > " Franky" <frankieNOSPAM@a-znet.com> schreef in bericht > news:ejoKw8uFHHA.2296@TK2MSFTNGP04.phx.gbl... >> Cor >> >> This is more a design question rather that an implementation question. >> >> I know how to delete items. >> >> I can't think of a neat way for the user to select the items to be >> deleted. >> >> One possibility is for the user to click an item so that it appears in >> the text box, and the button might say "Delete item showing in Textbox" >> >> It just occurred to me that the items might be able to display a checkbox >> next to them - is that possible in a combobox -I'll have to check. If >> that is possible the user could check the items to be deleted while the >> dropdown list is showing. >> >> A quick test led me to believe Combobox gets a click event if I click in >> the textbox or cause a dropdown. It does not get one if I click and item >> in the dropdown. >> >> Maybe in WndProc I could catch the right click and figure out which item >> the user clicked. Does that seem like a way to go??? >> >> >> ... >> >> >> >>>>>>I have a usercontrol that inherits from ComboBox >>>>>> >>>>>> I'd like to add the feature that the user can delete any item >>>>>> >>>>>> Best would be that he could right click an element and a messagebox >>>>>> would ask if he wanted to delete that element >>>>>> >>>>>> I can't find an event that would enable me to do that. >>>>>> >>>>>> I could copy the items into a text box, let him edit it and put them >>>>>> back >>>>>> >> >> ... >> > >
enter key press
About deleting file on Vista 64bit Database Connection Designer Variables Newbie: error trying to save directory path to database Working with a database How to set an objects property using Reflection PIAs for Excel 9.0 Make Code Fail How Do I Kill Non-Printable Characters? Select All CheckBoxes Key Validation |
|||||||||||||||||||||||