Popover Question

Is it possible to show a popover at the mouse position?

I am trying to achieve this when a user “DoublePressed” a cell in a listbox but i am at a loss on where to start.

All i have in the DoublePressed event is,

Var c As New Popover1 // Container
c.ShowPopover(Listbox1) 

This shows the popover at the bottom of the listbox (Listbox is locked to bottom) and displays outside the window.

Any help would be greatly appreciated!

Robin

This was regarded as feature request and is supposed to come in 2024r3. I cheated by using a small canvas. The DoubleClick event calculates y for the listbox:

dim row as Integer = me.GetChildRowNumber(theRow)
dim yCoordinate as Integer = ((row - me.scrollPosition) * me.RowHeight) + me.RowHeight/2
dim xCoordinate as Integer = LBMailboxes.Width/2

if BottomBarStatus = BottomBarStatusEnum.Enabled then
  ShowMailboxRenameWindow(theRow, xCoordinate, yCoordinate)
end if

And then in ShowMailboxRenameWindow the canvas (CForPopover) is positioned and the popover shown:

'show the rename mailbox window
CForPopover.Left = LBMailboxes.TrueBoundary.Left + x
CForPopover.Top = LBMailboxes.TrueBoundary.Top + y

dim NameChange as new MailboxNameChangeWindow(theRow.Text)
NameChange.ShowPopover(CForPopover)

The x coordinate could be better but for now I’m happy:

4 Likes

Ah! thank you Beatrix, will give this a go.

I took a similar path to @Beatrix_Willius and made a DesktopContainer subclass. Here’s a simple example project.

5 Likes