Many thanks
Roger Billsdon
Private Sub m_removeAllKeyboardShortcuts(ByRef visDoc As Visio.Document)
'// Get a the ui object:
Dim ui As Visio.UIObject = visDoc.Application.BuiltInMenus.Clone '.Clone
Dim accTbl As Visio.AccelTable
'// For each menu context:
For iCtx As Integer = 0 To ui.AccelTables.Count - 1
accTbl = ui.AccelTables.Item(iCtx)
Debug.WriteLine("----" & accTbl.TableName & "----")
'// For each accel item in the context:
For i As Integer = accTbl.AccelItems.Count - 1 To 1 Step -1
accTbl.AccelItems.Item(i).Delete()
Next
Next
visDoc.SetCustomMenus(ui)
End Sub
--
Hope this helps,
Chris Roth
Visio MVP
"Roger" <Ro...@discussions.microsoft.com> wrote in message
news:7047CF26-DC28-4CCA...@microsoft.com...
Among my other ideas was overriding the ProcessCmdKey, PreProcessMessage and
other functions for the Visio Drawing Control and the containing form. I
thought this might provide a means of trapping short-cut keys before they
were processed by the Visio Drawing Control. But no success.
I found a discussion between JuneTheSecond and xargon dated April 2005 on
Visio Drawing Control keypress event handling problems, but no solution was
reported.
Any further comments would be very welcome.
Many thanks
Roger Billsdon
"Roger" <Ro...@discussions.microsoft.com> wrote in message
news:B8EEC8F6-63D7-4801...@microsoft.com...
Checking the accelerator item's Alt, Shift and Control properties plus
comparing the Key property with the Keys enumeration enables you to find the
short-cut keys you specifically need to disable. An alternative would be to
check the CmdNum property.