# EmedWithin / EmbedWithinPanel issues

**URL:** <https://forum.xojo.com/t/emedwithin-embedwithinpanel-issues/79534>\
**Category:** Bugs and Feature Requests\
**Created:** [March 10, 2024, 3:04pm UTC](https://forum.xojo.com/t/emedwithin-embedwithinpanel-issues/79534 "2024-03-10T15:04:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sveinn\_Runar\_Sigurdsson](https://forum.xojo.com/user_avatar/forum.xojo.com/sveinn_runar_sigurdsson/32/23640_2.png) [@Sveinn\_Runar\_Sigurdsson](https://forum.xojo.com/u/Sveinn_Runar_Sigurdsson)\
**Post date:** [March 10, 2024, 3:04pm UTC](https://forum.xojo.com/t/emedwithin-embedwithinpanel-issues/79534/1 "2024-03-10T15:04:10Z")

</div>

The following command (where objctrl is reference to a dynamically created desktopcontainer etc.

```auto
OptionsControl.EmbedWithin(objCtrl,10,10)

```

Will NOT result in the same as

```auto
OptionsControl.EmbedWithin(objCtrl)
OptionsControl.Left = 10
OptionsControl.top = 10

```

The issue was that using the EmbedWithin / EmbedWithinPanel to both embed the object AND place it, was giving me weird ■■■ conclusions, but when I added the .left and .top position lines AFTER, it worked fine.

My custom dropdown control:

 ![image](https://forum.xojo.com/uploads/default/original/3X/1/1/1149618c0fe70e3d4c39628e112de8c15817a36d.png)

Displaying options (which didn’t work unless separating the LEFT / TOP from the embedwithin /embedwithinpanel command)

 ![image](https://forum.xojo.com/uploads/default/original/3X/2/b/2bcd0142892225b1bf9b00c0f7bbde0d33221a9a.png)

---

<div class="post-metadata">

**Author:** ![James\_Pitchford](https://forum.xojo.com/user_avatar/forum.xojo.com/james_pitchford/32/4568_2.png) [@James\_Pitchford](https://forum.xojo.com/u/James_Pitchford)\
**Post date:** [March 11, 2024, 2:42pm UTC](https://forum.xojo.com/t/emedwithin-embedwithinpanel-issues/79534/2 "2024-03-11T14:42:17Z")

</div>

left and top in the constructor are in reference to the containing Control or window - i.e. they refer to objCtrl.left and objCtrl.top not optionsControl.left and optionsControl.top.
