TypeAndMemberDropdownBars.OnItemChosen(Int32, Int32) Method

Definition

Called when an item is chosen from the specified combo box.

public:
 virtual int OnItemChosen(int combo, int entry);
public:
 virtual int OnItemChosen(int combo, int entry);
 virtual int OnItemChosen(int combo, int entry);
public virtual int OnItemChosen (int combo, int entry);
abstract member OnItemChosen : int * int -> int
override this.OnItemChosen : int * int -> int
Public Overridable Function OnItemChosen (combo As Integer, entry As Integer) As Integer

Parameters

combo
Int32

[in] The ID of the combo box (0 for the types combo box, 1 for the members combo box).

entry
Int32

[in] The index of the entry that was chosen.

Returns

If successful, returns S_OK; otherwise, returns an error code.

Implements

Remarks

This method is called when the selected item is chosen, that is, the user clicked on an entry in a combo box. The OnItemSelected method is called when the item is highlighted but not necessarily clicked on.

This method is an implementation of the OnItemChosen method on the IVsDropdownBarClient interface.

The base method calls the GetMember method to retrieve the requested entry. If the entry is found, the span is obtained from the entry and the CenterLines method is called on the IVsTextView object that was passed to the internal method SynchronizeDropdowns (see the "Notes for Callers" section in the TypeAndMemberDropdownBars class for details on this internal method). Then the SetCaretPos method is called on the IVsTextView object, followed by the SetFocus method, and finally the internal method SynchronizeDropdowns is called to make sure the combo boxes reflect the new position of the caret. The base method always returns a success code of S_OK.

Applies to