Accelerator Keys

G

GWizz

Have the following piece of code which reads in a file and populates a frame
with option buttons :-

'Place the OptionButtons on the dialog box
For intXXX = 0 To intButts - 1
Set MyCmd = frMenu.Controls.Add("forms.OptionButton.1", True)
MyCmd.Left = intXOffSet
MyCmd.Top = intYOffSet + ((intXXX - 1) * intSpacing)
MyCmd.Width = 300
MyCmd.Height = 20
MyCmd.Caption = strMenu(intXXX)
MyCmd.Accelerator = strAccKey(intXXX)
Debug.Print strMenu(intXXX), strAccKey(intXXX)
If intXXX = 0 Then
MyCmd.Value = True 'Sets default to OptBtn 1
End If
Next intXXX

Problem is the Accelerator Keys section doesn't work. No error messages or
anything, but they just don't show and don't activate either.

Anyone any ideas ?

Regards


--
 
G

GWizz

Suffice it to say my file (the one that was read in) was formatted as follows

MenuOptionName, AcelleratorKeyCharacter, TemplateName

What i didn't realise was leaving the spaces after the column makes the
Accellerator keyy Character 2 characters and it only reads the first
character ie the space.

Regards
--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top