In a message regarding ListBox Select All dated Thu, 25 May 2006 22:40:56
-0400, RBNUBE said that ...

> There has to be a simple answer for this.

> I am trying to code a select all feature for a ListBox.  I made a new Method
> and I call it from a MenuItem as well as the associated command keys, and it
> works fine.  When I call it from a ContextualMenu, it doesn't.

How are you constructing your contextual menu? Are you using the same
MenuItem as the one that works from a fixed menu?

This quick and dirty test works for me on Windows:

// Menu handler
Function mnuSelectAllLB() As Boolean
  for i as Integer = ListBox1.ListCount-1 DownTo 0
    ListBox1.Selected(i) = True
  next i
  Return true
End Function

//Listbox1.ConstructContextualMenu
Function ConstructContextualMenu(base as MenuItem, x as Integer, _
       y as Integer) As Boolean
  base.Append mnuSelectAllLB
  Return True
End Function


--
Steve Garman
Using REALbasic 2006r2 Professional on Windows XP Pro



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to