property Item.ShowPopupOffset as String
Specifies the offset (horizontal,vertical) to display the item's submenu/popup relative to its default position.

TypeDescription
String A String expression that specifies  the offset as a pair (horizontal, vertical) to display the item's submenu/popup relative to its default position. 

The horizontal/vertical can be one of the following:

  • number, indicating the x,y-offset relative to default position of the drop down panel. The number can be can be followed by a D character which indicates that the coordinate is giving in dots, rather than pixels, and depends on the current DPI settings. For instance, ShowPopupOffset = "12D,12D", indicates that the inner popup is moved by 18,18 pixels if the DPI settings is 150%, while if DPI settings is 100% the popup is moved by 12,12 pixels, relative to its current position. The numberD converted in pixels is number * DPI / 100.
  • number:control, indicating the x,y-offset relative to control.
  • number:screen, indicating the x,y-absolute position on the screen.
By default, the ShowPopupOffset property is empty ( equivalent with the "0,0" ). The ShowPopupOffset property specifies the offset as a pair (horizontal,vertical) to display the item's submenu/popup relative to its default position/control or screen. Use the ShowPopupAt property to specify the identifier of the item where the current item's submenu/popup is displayed.

For instance, the following sample, displays the item's drop down relative to the control ( call ShowPopupOffset ):

With ToolBar1
	.PopupAppearance = ShadowBorder
	With .Items
		With .Add("Popup <b>1",2,100)
			.ShowPopupArrow = False
			.ShowPopupAlign = exShowPopupAlignDown
			.ShowPopupOffset = "0,0:control"
			With .Items
				.Add "Item 1"
				.Add "Item 2"
				.Add "Item 3"
			End With
		End With
		With .Add("Popup <b>2",2,200)
			.GroupPopup = exGroupPopup
			With .Items
				.Add "Item 2"
				.Add "Item 3"
				.Add "Item 4"
			End With
		End With
	End With
	.Refresh 
End With

and we get:

while following sample displays the item's drop down at its default position ( no ShowPopupOffset call, default ):

With ToolBar1
	.PopupAppearance = ShadowBorder
	With .Items
		With .Add("Popup <b>1",2,100)
			.ShowPopupArrow = False
			.ShowPopupAlign = exShowPopupAlignDown
			.ShowPopupOffset = "0,0:control"
			With .Items
				.Add "Item 1"
				.Add "Item 2"
				.Add "Item 3"
			End With
		End With
		With .Add("Popup <b>2",2,200)
			.GroupPopup = exGroupPopup
			With .Items
				.Add "Item 2"
				.Add "Item 3"
				.Add "Item 4"
			End With
		End With
	End With
	.Refresh 
End With

and we get:

How can I display the drop down popup to a different position?

VBA (MS Access, Excell...)

With ToolBar1
	With .Items
		With .Add("Popup",2,100)
			.ShowPopupAlign = 1
			.ShowPopupArrow = False
			.ShowPopupOffset = "-12,-48"
			With .Items
				.PopupAppearance = 3
				.Add "Item 1"
				.Add "Item 2"
				.Add "Item 3"
			End With
		End With
	End With
	.Refresh 
End With

VB6

With ToolBar1
	With .Items
		With .Add("Popup",2,100)
			.ShowPopupAlign = exShowPopupAlignDown
			.ShowPopupArrow = False
			.ShowPopupOffset = "-12,-48"
			With .Items
				.PopupAppearance = RaisedBorder
				.Add "Item 1"
				.Add "Item 2"
				.Add "Item 3"
			End With
		End With
	End With
	.Refresh 
End With

VB.NET

With Extoolbar1
	With .Items
		With .Add("Popup",2,100)
			.ShowPopupAlign = exontrol.EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown
			.ShowPopupArrow = False
			.ShowPopupOffset = "-12,-48"
			With .Items
				.PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.RaisedBorder
				.Add("Item 1")
				.Add("Item 2")
				.Add("Item 3")
			End With
		End With
	End With
	.Refresh()
End With

VB.NET for /COM

With AxToolBar1
	With .Items
		With .Add("Popup",2,100)
			.ShowPopupAlign = EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown
			.ShowPopupArrow = False
			.ShowPopupOffset = "-12,-48"
			With .Items
				.PopupAppearance = EXTOOLBARLib.AppearanceEnum.RaisedBorder
				.Add("Item 1")
				.Add("Item 2")
				.Add("Item 3")
			End With
		End With
	End With
	.Refresh()
End With

C++

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

	#import <ExToolBar.dll>
	using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
	EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Popup",long(2),long(100));
		var_Item->PutShowPopupAlign(EXTOOLBARLib::exShowPopupAlignDown);
		var_Item->PutShowPopupArrow(VARIANT_FALSE);
		var_Item->PutShowPopupOffset(L"-12,-48");
		EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
			var_Items1->PutPopupAppearance(EXTOOLBARLib::RaisedBorder);
			var_Items1->Add(L"Item 1",vtMissing,vtMissing);
			var_Items1->Add(L"Item 2",vtMissing,vtMissing);
			var_Items1->Add(L"Item 3",vtMissing,vtMissing);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
	Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Popup",TVariant(2),TVariant(100));
		var_Item->ShowPopupAlign = Extoolbarlib_tlb::ShowPopupAlignEnum::exShowPopupAlignDown;
		var_Item->ShowPopupArrow = false;
		var_Item->ShowPopupOffset = L"-12,-48";
		Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
			var_Items1->PopupAppearance = Extoolbarlib_tlb::AppearanceEnum::RaisedBorder;
			var_Items1->Add(L"Item 1",TNoParam(),TNoParam());
			var_Items1->Add(L"Item 2",TNoParam(),TNoParam());
			var_Items1->Add(L"Item 3",TNoParam(),TNoParam());
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
	exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Popup",2,100);
		var_Item.ShowPopupAlign = exontrol.EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
		var_Item.ShowPopupArrow = false;
		var_Item.ShowPopupOffset = "-12,-48";
		exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
			var_Items1.PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.RaisedBorder;
			var_Items1.Add("Item 1",null,null);
			var_Items1.Add("Item 2",null,null);
			var_Items1.Add("Item 3",null,null);
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	var var_Items = ToolBar1.Items;
		var var_Item = var_Items.Add("Popup",2,100);
			var_Item.ShowPopupAlign = 1;
			var_Item.ShowPopupArrow = false;
			var_Item.ShowPopupOffset = "-12,-48";
			var var_Items1 = var_Item.Items;
				var_Items1.PopupAppearance = 3;
				var_Items1.Add("Item 1",null,null);
				var_Items1.Add("Item 2",null,null);
				var_Items1.Add("Item 3",null,null);
	ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With ToolBar1
		With .Items
			With .Add("Popup",2,100)
				.ShowPopupAlign = 1
				.ShowPopupArrow = False
				.ShowPopupOffset = "-12,-48"
				With .Items
					.PopupAppearance = 3
					.Add "Item 1"
					.Add "Item 2"
					.Add "Item 3"
				End With
			End With
		End With
		.Refresh 
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
	EXTOOLBARLib.Item var_Item = var_Items.Add("Popup",2,100);
		var_Item.ShowPopupAlign = EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
		var_Item.ShowPopupArrow = false;
		var_Item.ShowPopupOffset = "-12,-48";
		EXTOOLBARLib.Items var_Items1 = var_Item.Items;
			var_Items1.PopupAppearance = EXTOOLBARLib.AppearanceEnum.RaisedBorder;
			var_Items1.Add("Item 1",null,null);
			var_Items1.Add("Item 2",null,null);
			var_Items1.Add("Item 3",null,null);
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_Item,com_Items,com_Items1;
	anytype var_Item,var_Items,var_Items1;
	;

	super();

	var_Items = extoolbar1.Items(); com_Items = var_Items;
		var_Item = com_Items.Add("Popup",COMVariant::createFromInt(2),COMVariant::createFromInt(100)); com_Item = var_Item;
			com_Item.ShowPopupAlign(1/*exShowPopupAlignDown*/);
			com_Item.ShowPopupArrow(false);
			com_Item.ShowPopupOffset("-12,-48");
			var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
				com_Items1.PopupAppearance(3/*RaisedBorder*/);
				com_Items1.Add("Item 1");
				com_Items1.Add("Item 2");
				com_Items1.Add("Item 3");
	extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
	with Items do
	begin
		with Add('Popup',TObject(2),TObject(100)) do
		begin
			ShowPopupAlign := EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
			ShowPopupArrow := False;
			ShowPopupOffset := '-12,-48';
			with Items do
			begin
				PopupAppearance := EXTOOLBARLib.AppearanceEnum.RaisedBorder;
				Add('Item 1',Nil,Nil);
				Add('Item 2',Nil,Nil);
				Add('Item 3',Nil,Nil);
			end;
		end;
	end;
	Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
	with Items do
	begin
		with Add('Popup',OleVariant(2),OleVariant(100)) do
		begin
			ShowPopupAlign := EXTOOLBARLib_TLB.exShowPopupAlignDown;
			ShowPopupArrow := False;
			ShowPopupOffset := '-12,-48';
			with Items do
			begin
				PopupAppearance := EXTOOLBARLib_TLB.RaisedBorder;
				Add('Item 1',Null,Null);
				Add('Item 2',Null,Null);
				Add('Item 3',Null,Null);
			end;
		end;
	end;
	Refresh();
end

VFP

with thisform.ToolBar1
	with .Items
		with .Add("Popup",2,100)
			.ShowPopupAlign = 1
			.ShowPopupArrow = .F.
			.ShowPopupOffset = "-12,-48"
			with .Items
				.PopupAppearance = 3
				.Add("Item 1")
				.Add("Item 2")
				.Add("Item 3")
			endwith
		endwith
	endwith
	.Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
	var_Item = var_Items.Add("Popup",2,100)
		var_Item.ShowPopupAlign = 1
		var_Item.ShowPopupArrow = false
		var_Item.ShowPopupOffset = "-12,-48"
		var_Items1 = var_Item.Items
			var_Items1.PopupAppearance = 3
			var_Items1.Add("Item 1")
			var_Items1.Add("Item 2")
			var_Items1.Add("Item 3")
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
	var_Item = var_Items.Add("Popup",2,100)
		var_Item.ShowPopupAlign = 1
		var_Item.ShowPopupArrow = .f.
		var_Item.ShowPopupOffset = "-12,-48"
		var_Items1 = var_Item.Items
			var_Items1.PopupAppearance = 3
			var_Items1.Add("Item 1")
			var_Items1.Add("Item 2")
			var_Items1.Add("Item 3")
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
	var_Item := var_Items:Add("Popup",2,100)
		var_Item:ShowPopupAlign := exShowPopupAlignDown
		var_Item:ShowPopupArrow := false
		var_Item:ShowPopupOffset := "-12,-48"
		var_Items1 := var_Item:Items
			var_Items1:PopupAppearance := RaisedBorder
			var_Items1:Add("Item 1",nil,nil)
			var_Items1:Add("Item 2",nil,nil)
			var_Items1:Add("Item 3",nil,nil)
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
	var_Item = var_Items.Add("Popup",2,100)
		var_Item.ShowPopupAlign = 1
		var_Item.ShowPopupArrow = false
		var_Item.ShowPopupOffset = "-12,-48"
		var_Items1 = var_Item.Items
			var_Items1.PopupAppearance = 3
			var_Items1.Add("Item 1")
			var_Items1.Add("Item 2")
			var_Items1.Add("Item 3")
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Variant voItems
	Get ComItems to voItems
	Handle hoItems
	Get Create (RefClass(cComItems)) to hoItems
	Set pvComObject of hoItems to voItems
		Variant voItem
		Get ComAdd of hoItems "Popup" 2 100 to voItem
		Handle hoItem
		Get Create (RefClass(cComItem)) to hoItem
		Set pvComObject of hoItem to voItem
			Set ComShowPopupAlign of hoItem to OLEexShowPopupAlignDown
			Set ComShowPopupArrow of hoItem to False
			Set ComShowPopupOffset of hoItem to "-12,-48"
			Variant voItems1
			Get ComItems of hoItem to voItems1
			Handle hoItems1
			Get Create (RefClass(cComItems)) to hoItems1
			Set pvComObject of hoItems1 to voItems1
				Set ComPopupAppearance of hoItems1 to OLERaisedBorder
				Get ComAdd of hoItems1 "Item 1" Nothing Nothing to Nothing
				Get ComAdd of hoItems1 "Item 2" Nothing Nothing to Nothing
				Get ComAdd of hoItems1 "Item 3" Nothing Nothing to Nothing
			Send Destroy to hoItems1
		Send Destroy to hoItem
	Send Destroy to hoItems
	Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oItem
	LOCAL oItems,oItems1
	LOCAL oToolBar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oToolBar := XbpActiveXControl():new( oForm:drawingArea )
	oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
	oToolBar:create(,, {10,60},{610,370} )

		oItems := oToolBar:Items()
			oItem := oItems:Add("Popup",2,100)
				oItem:ShowPopupAlign := 1/*exShowPopupAlignDown*/
				oItem:ShowPopupArrow := .F.
				oItem:ShowPopupOffset := "-12,-48"
				oItems1 := oItem:Items()
					oItems1:PopupAppearance := 3/*RaisedBorder*/
					oItems1:Add("Item 1")
					oItems1:Add("Item 2")
					oItems1:Add("Item 3")
		oToolBar:Refresh()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN