Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use Arrow keys in optionbutton
Greg,
Thanks a lot! that's solve my problem on how to change the value of the option button. However, the controls in my userform react differently with what I expected when I use the arrow keys. I guess I have no problem with the tabstop and tabindex because it works fine when I use the tab key. Why is it that when I use the arrow keys it jumps over some of the optionbutton? It also set focus on the other two controls which are commandbuttons (one is the default button and the other is the cancel button). I am disgusted with the result and I could not imagine what more will be the reaction of the intended users. Please help! Jon-jon "Greg Wilson" wrote in message ... Assuming you have three option buttons then include the following code in the UF code module: Private Sub OptionButton1_Enter() OptionButton1.Value = True End Sub Private Sub OptionButton2_Enter() OptionButton2.Value = True End Sub Private Sub OptionButton3_Enter() OptionButton3.Value = True End Sub Regards, Greg -----Original Message----- Hello Newsgroup, My useform contains optionbuttons with only one groupname so when one button is selected (true) the other will be deselected (false) . The first button is default to true. How can I make the option button respond to arrow keys so that when the I press Arrowdown button below the selected button will be the one selected and when I press ArrowUp the button above will be selected. Thanks in advance, Jon-jon . |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use Arrow keys in optionbutton
Assuming the frame holding your option buttons is named
Frame1 and the command buttons are respectively CommandButton1 and CommandButton2 then include the following code in the UF code module to prevent shifting focus to the commandbuttons. Private Sub CommandButton1_Enter() Frame1.SetFocus End Sub Private Sub CommandButton2_Enter() Frame1.SetFocus End Sub I can't replicate skipping of the option buttons using the arrow keys. Questions: 1) Are the tab index numbers 0, 1, 2, 3 . . . etc. 2) Are all the tab stops set to true? 3) Is there a group name applied to any control? 4) Are they all in the same frame? 5) How are they arranged? All in a column/row or what? 6) Have you double checked the option button code to see if there isn't an instruction causing this? A code error like in the following is what I have in mind although this won't cause skipping per se. Private Sub OptionButton3_Enter() OptionButton4 = True End Sub Regards, Greg -----Original Message----- Greg, Thanks a lot! that's solve my problem on how to change the value of the option button. However, the controls in my userform react differently with what I expected when I use the arrow keys. I guess I have no problem with the tabstop and tabindex because it works fine when I use the tab key. Why is it that when I use the arrow keys it jumps over some of the optionbutton? It also set focus on the other two controls which are commandbuttons (one is the default button and the other is the cancel button). I am disgusted with the result and I could not imagine what more will be the reaction of the intended users. Please help! Jon-jon "Greg Wilson" wrote in message ... Assuming you have three option buttons then include the following code in the UF code module: Private Sub OptionButton1_Enter() OptionButton1.Value = True End Sub Private Sub OptionButton2_Enter() OptionButton2.Value = True End Sub Private Sub OptionButton3_Enter() OptionButton3.Value = True End Sub Regards, Greg -----Original Message----- Hello Newsgroup, My useform contains optionbuttons with only one groupname so when one button is selected (true) the other will be deselected (false) . The first button is default to true. How can I make the option button respond to arrow keys so that when the I press Arrowdown button below the selected button will be the one selected and when I press ArrowUp the button above will be selected. Thanks in advance, Jon-jon . . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use Arrow keys in optionbutton
Greg,
Thanks again for the reply. My answer. 1) Yes, tab index is in that order. When I use the tab key it works fine. 2) Yes, all true 3) All Optionbuttons have the same groupname 4) I use no frame but I will try. This might solve it 5) Arrange in column 6) Code is ok Regards, Jon-jon "Greg Wilson" wrote in message ... Assuming the frame holding your option buttons is named Frame1 and the command buttons are respectively CommandButton1 and CommandButton2 then include the following code in the UF code module to prevent shifting focus to the commandbuttons. Private Sub CommandButton1_Enter() Frame1.SetFocus End Sub Private Sub CommandButton2_Enter() Frame1.SetFocus End Sub I can't replicate skipping of the option buttons using the arrow keys. Questions: 1) Are the tab index numbers 0, 1, 2, 3 . . . etc. 2) Are all the tab stops set to true? 3) Is there a group name applied to any control? 4) Are they all in the same frame? 5) How are they arranged? All in a column/row or what? 6) Have you double checked the option button code to see if there isn't an instruction causing this? A code error like in the following is what I have in mind although this won't cause skipping per se. Private Sub OptionButton3_Enter() OptionButton4 = True End Sub Regards, Greg -----Original Message----- Greg, Thanks a lot! that's solve my problem on how to change the value of the option button. However, the controls in my userform react differently with what I expected when I use the arrow keys. I guess I have no problem with the tabstop and tabindex because it works fine when I use the tab key. Why is it that when I use the arrow keys it jumps over some of the optionbutton? It also set focus on the other two controls which are commandbuttons (one is the default button and the other is the cancel button). I am disgusted with the result and I could not imagine what more will be the reaction of the intended users. Please help! Jon-jon "Greg Wilson" wrote in message ... Assuming you have three option buttons then include the following code in the UF code module: Private Sub OptionButton1_Enter() OptionButton1.Value = True End Sub Private Sub OptionButton2_Enter() OptionButton2.Value = True End Sub Private Sub OptionButton3_Enter() OptionButton3.Value = True End Sub Regards, Greg -----Original Message----- Hello Newsgroup, My useform contains optionbuttons with only one groupname so when one button is selected (true) the other will be deselected (false) . The first button is default to true. How can I make the option button respond to arrow keys so that when the I press Arrowdown button below the selected button will be the one selected and when I press ArrowUp the button above will be selected. Thanks in advance, Jon-jon . . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use Arrow keys in optionbutton
I cannot replicate skipping of the option buttons using
the arrow keys even if I give them different group names and do not put them in a frame. When they have the same group names, by design, they are mutually exclusive. All I can produce when I give one a different group name is the ability to be independant of the others. The focus still shifts from one to the other in sequence when using the arrow keys. If you find that you still can't resolve the problem then I suggest just deleting them and adding new ones. However, I suggest always adding a new one from the toolbox instead of copying an option button and pasting. I've run into a bug doing this with a RefEdit control before. If there are a lot of them then they can be added programmatically, which should ensure accurate dimentioning and positioning. Regards, Greg -----Original Message----- Greg, Thanks again for the reply. My answer. 1) Yes, tab index is in that order. When I use the tab key it works fine. 2) Yes, all true 3) All Optionbuttons have the same groupname 4) I use no frame but I will try. This might solve it 5) Arrange in column 6) Code is ok Regards, Jon-jon "Greg Wilson" wrote in message ... Assuming the frame holding your option buttons is named Frame1 and the command buttons are respectively CommandButton1 and CommandButton2 then include the following code in the UF code module to prevent shifting focus to the commandbuttons. Private Sub CommandButton1_Enter() Frame1.SetFocus End Sub Private Sub CommandButton2_Enter() Frame1.SetFocus End Sub I can't replicate skipping of the option buttons using the arrow keys. Questions: 1) Are the tab index numbers 0, 1, 2, 3 . . . etc. 2) Are all the tab stops set to true? 3) Is there a group name applied to any control? 4) Are they all in the same frame? 5) How are they arranged? All in a column/row or what? 6) Have you double checked the option button code to see if there isn't an instruction causing this? A code error like in the following is what I have in mind although this won't cause skipping per se. Private Sub OptionButton3_Enter() OptionButton4 = True End Sub Regards, Greg -----Original Message----- Greg, Thanks a lot! that's solve my problem on how to change the value of the option button. However, the controls in my userform react differently with what I expected when I use the arrow keys. I guess I have no problem with the tabstop and tabindex because it works fine when I use the tab key. Why is it that when I use the arrow keys it jumps over some of the optionbutton? It also set focus on the other two controls which are commandbuttons (one is the default button and the other is the cancel button). I am disgusted with the result and I could not imagine what more will be the reaction of the intended users. Please help! Jon-jon "Greg Wilson" wrote in message ... Assuming you have three option buttons then include the following code in the UF code module: Private Sub OptionButton1_Enter() OptionButton1.Value = True End Sub Private Sub OptionButton2_Enter() OptionButton2.Value = True End Sub Private Sub OptionButton3_Enter() OptionButton3.Value = True End Sub Regards, Greg -----Original Message----- Hello Newsgroup, My useform contains optionbuttons with only one groupname so when one button is selected (true) the other will be deselected (false) . The first button is default to true. How can I make the option button respond to arrow keys so that when the I press Arrowdown button below the selected button will be the one selected and when I press ArrowUp the button above will be selected. Thanks in advance, Jon-jon . . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Arrow Keys | Excel Discussion (Misc queries) | |||
Arrow Keys | Excel Discussion (Misc queries) | |||
arrow keys | Excel Worksheet Functions | |||
ARrow Keys | Excel Worksheet Functions | |||
arrow keys | Excel Discussion (Misc queries) |