ListBox Header and ContextualMenu

Hi,

I was fooling around while waiting Internet to come back to me… on ContextualMenus and ListBox.

Things started bad:
Xojo was attempting to make a connexion to the internet at launch time…
Xojo Language Reference was attempting to make a connexion to the internet at open time… and I had to wait, wait, wait.

After…, I started to search if I am able to make the ContextualMenu whem I activate above the Heading: no, it is not possible. “Isn’t It A Pity” (GH)
Worst: the ListBox act just like if you click in the Column! “Isn’t It A Shame ?” (GH)

Beside using Canvas, etc., is it really not possible to make the ContextualMenu appearing when the click is done in the Heading ?
(The ListBox number of columns is dynamically changed at data feeding time…)

Of course you can… You just need to do it yourself in MouseDown.

It;s easy to determine if it is a contextual header click.

If The listbox has rows added it’s easy to figure out the column with listbox.column(x,y). If the listbox does not have data you beed to iterate through the column column width to find the column.

  • Karen

In the MouseDown event:

If IsContextualClick Then ... Return True End

Hi Karen,

I already figured how to do in the ListBox data display area (not Heading).

I wanted to make a “Number of selected Rows” feature, but it does not worked as I was thinking, and I prefered to add a window to report that and some other properties: better for newbie users to get that there than to have to press the shift key to not loose selected rows… ;-:).

Eli: another good advice !

Thank to you Karen and Eli.