tags:

views:

206

answers:

1

I need some help in MFC. The following is my problem:

  1. I have two controls a static text and a checkbox
  2. When using MFC Wizard, i place a '&' in front of one of the letters in the static text, while executing if i press Alt+, the checkbox either gets enabled or disabled.
  3. Now my problem is i am adding these controls programaticaly, and even though i have the '&' placed in the static text, if i press the Alt+, it doesn't change the state of the checkbox control.

My queries are:

  1. Can anyone kindly let me know if there is some binding which has to be done in case we are adding the controls programatically.
  2. If someone can briefly explain how the binding is taken care by MFC it will be gr8 help

edit: One more thing the checkbox won't have any text associated with it.

+1  A: 

Since the static text is not associated with the checkbox control, how can the system know which checkbox it should link? I bet if you look at the TAB ordering and the group settings of the controls, you will arrive at your solution.

adzm
hmm..i did try tab ordering.... but the problem for me is there is no text as such attached with the checkbox, hence even if the shortcut key is pressed and the control gets selected, the user won't know about the selection until he presses space bar :(
Raghu