Partager via


TypeAndMemberDropdownBars.OnItemChosen Method

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

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

Syntax

'Declaration
Public Overridable Function OnItemChosen ( _
    combo As Integer, _
    entry As Integer _
) As Integer
public virtual int OnItemChosen(
    int combo,
    int entry
)
public:
virtual int OnItemChosen(
    int combo, 
    int entry
)
abstract OnItemChosen : 
        combo:int * 
        entry:int -> int  
override OnItemChosen : 
        combo:int * 
        entry:int -> int
public function OnItemChosen(
    combo : int, 
    entry : int
) : int

Parameters

  • combo
    Type: Int32

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

  • entry
    Type: Int32

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

Return Value

Type: Int32
If successful, returns S_OK; otherwise, returns an error code.

Implements

IVsDropdownBarClient.OnItemChosen(Int32, Int32)

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.

.NET Framework Security

See Also

Reference

TypeAndMemberDropdownBars Class

Microsoft.VisualStudio.Package Namespace