property Items.SelectableItem(Item as HITEM) as Boolean
Specifies whether the user can select the item. /*not supported in the lite version*/

 TypeDescription 
   Item as HITEM A long expression that indicates the handle of the item being selectable  
   Boolean A boolean expression that specifies whether the item is selectable.  
By default, all items are selectable, excepts the locked items that are not selectable. A selectable item is an item that user can select using the keys or the mouse. The SelectableItem property specifies whether the user can select an item. The SelectableItem property doesn't change the item's appearance. The LockedItemCount property specifies the number of locked items to the top or bottom side of the control. Use the ItemForeColor property to specifies the item's foreground color. Use the ItemBackColor property to specify the item's background color. Use the ItemFont, ItemBold, ItemItalic, ItemUnderline or ItemStrikeOut property to assign a different font to the item. Use the EnableItem property to disable an item. A disabled item looks grayed, but it is selectable. For instance, the user can't change the check box state in a disabled item. Use the SelectItem or Select property to select an item. The ItemFromPoint property gets the item from point. For instance, if the user clicks a non selectable item the SelectionChanged or Change event is not fired. A non selectable item is not focusable as well. It means that if the incremental searching is on, the non selectable items are ignored. If the user selects an item, and then he declares the item as non selectable after, the control clears the control's label and its selection. Use the SelectCount property to get the number of selected items. The control highlights a selectable item when cursor hovers the item, and doesn't highlight a non selectable item. Use the SelForeColor and SelBackColor properties to customize the colors for selected items. 

For instance, if the user clicks a non selectable item, the control doesn't close its drop down portion, so it waits until the user selects a new item.

The following VB sample makes not selectable the first visible item:

With ComboBox1.Items
    .SelectableItem(.FirstVisibleItem) = False
End With

The following C++ sample makes not selectable the first visible item:

#include "Items.h"
CItems items = m_combobox.GetItems();
items.SetSelectableItem( items.GetFirstVisibleItem(), FALSE );

The following VB.NET sample makes not selectable the first visible item:

With AxComboBox1.Items
    .SelectableItem(.FirstVisibleItem) = False
End With

The following C# sample makes not selectable the first visible item:

axComboBox1.Items.set_SelectableItem(axComboBox1.Items.FirstVisibleItem, false);

The following VFP sample makes not selectable the first visible item:

with thisform.ComboBox1.Items
	.DefaultItem = .FirstVisibleItem
	.SelectableItem(0) = .f.
endwith

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.