SubMenu with bevelbutton

Hi all,

is it possible to add submenu in menu of bevelbutton ?

How do it with addrow method ?

Thanks for your help :slight_smile:

Solution :

[code]Function MouseDown(X As Integer, Y As Integer) As Boolean
Dim AnneeMenu as New MenuItem

Dim subannee As New MenuItem(鈥2016鈥)
subannee.Append(New MenuItem(鈥淛anvier 2016鈥))
subannee.Append(New MenuItem(鈥淔vrier 2016鈥))
subannee.Append(New MenuItem(鈥淢ars 2016鈥))
subannee.Append(New MenuItem(鈥淎vril 2016鈥))
subannee.Append(New MenuItem(鈥淢ai 2016鈥))
subannee.Append(New MenuItem(鈥淛uin 2016鈥))
subannee.Append(New MenuItem(鈥淛uillet 2016鈥))
subannee.Append(New MenuItem(鈥淎ot 2016鈥))
subannee.Append(New MenuItem(鈥淪eptembre 2016鈥))
subannee.Append(New MenuItem(鈥淥ctobre 2016鈥))
subannee.Append(New MenuItem(鈥淣ovembre 2016鈥))
subannee.Append(New MenuItem(鈥淒cembre 2016鈥))

AnneeMenu.Append subannee

dim menuchoice as MenuItem = AnneeMenu.PopUp(me.Left+10,me.top+me.height+70)
if menuchoice<>nil then
me.caption=menuchoice.Text
end if

Return true
End Function
[/code]

[quote=297078:@JrmeLeray]Solution :

[code]Function MouseDown(X As Integer, Y As Integer) As Boolean
Dim AnneeMenu as New MenuItem

Dim subannee As New MenuItem(鈥2016鈥)
subannee.Append(New MenuItem(鈥淛anvier 2016鈥))
subannee.Append(New MenuItem(鈥淔vrier 2016鈥))
subannee.Append(New MenuItem(鈥淢ars 2016鈥))
subannee.Append(New MenuItem(鈥淎vril 2016鈥))
subannee.Append(New MenuItem(鈥淢ai 2016鈥))
subannee.Append(New MenuItem(鈥淛uin 2016鈥))
subannee.Append(New MenuItem(鈥淛uillet 2016鈥))
subannee.Append(New MenuItem(鈥淎ot 2016鈥))
subannee.Append(New MenuItem(鈥淪eptembre 2016鈥))
subannee.Append(New MenuItem(鈥淥ctobre 2016鈥))
subannee.Append(New MenuItem(鈥淣ovembre 2016鈥))
subannee.Append(New MenuItem(鈥淒cembre 2016鈥))

AnneeMenu.Append subannee

dim menuchoice as MenuItem = AnneeMenu.PopUp(me.Left+10,me.top+me.height+70)
if menuchoice<>nil then
me.caption=menuchoice.Text
end if

Return true
End Function
[/code][/quote]
Merveilleux!!! Merci beaucoup :smiley: :smiley:

If I move the window then the popup is created outside.

Is the correct approach add self.left and self.top to .PopUp(,)?