Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disable ComboBox Item
Message
De
13/05/2008 00:20:38
 
 
À
13/05/2008 00:05:48
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01316515
Message ID:
01316565
Vues:
15
So you'll have to do some combination of coloring the item to give the indication of disabled. Then see if the SelectedIndex is set to one of the "disabled" items and maybe go to the next item?

>>Have you discovered what that other stuff is? Like I said, all the ownerdraw examples i saw had to do with color or size.
>
>I'll probably end up putting code in the OnSelectedIndexChanged method, I'll be working on it some more tomorrow.
>
>~~Bonnie
>
>
>>
>>
>>>Hi Perry,
>>>
>>>I'd need to some other stuff to actually prevent them from selecting something that's "disabled", but this OwnerDraw stuff at least gives a visual indication of it being "disabled". I don't want to remove the items, I want them to show up, but look like they're disabled.
>>>
>>>~~Bonnie
>>>
>>>
>>>
>>>>I was going to reply before, after I looked it up and can only see the owner. But I haven't found any examples of enabling/disabling using it. Just changing the size of the item or the color. So it seems to be used more for display properties of drawing something rather then event properties, so to speak.
>>>>
>>>>Actually, here someone responds to this exact question, asking why you just wouldn't remove the disabled items from the list and just not display them:
>>>>
>>>>http://discuss.develop.com/archives/wa.exe?A2=ind0304c&L=dotnet-winforms&D=0&P=4465
>>>>
>>>>
>>>>>>>Ha Ha Ha ... funny guy! You're sure a lot of help! <g>
>>>>>>>
>>>>>>
>>>>>>Ok, you're right.
>>>>>>
>>>>>>How about:
>>>>>>
>>>>>>
>>>>>>combo.Items[1].Enabled = false;
>>>>>>

>>>>>
>>>>>Funny guy again! If it was that easy, I wouldn't have to ask. <g>
>>>>>
>>>>>I'm playing with the owner-drawn stuff right now. It's not a 100% good solution, but I'm trying to refine it a bit.
>>>>>
>>>>>~~Bonnie

(On an infant's shirt): Already smarter than Bush
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform