Tabstop de Radiobuttons independent of the Checked property

Asked

Viewed 113 times

3

I have a set of Radiobuttons, Edits and Labels inside a Groupbox, as in the image below:

inserir a descrição da imagem aqui

I would like in the use of Tab the focus did not pass in any Radiobutton, and yes only in the Edits, for that, I thought of changing the property TabStop = False of all Radiobuttons.

Interestingly this property is already standard False and there is some logic (or bug) that always Radiobutton is Checked = True has its function as with TabStop = True, and all Radiobuttons with Checked = False function as TabStop = False.

Would there be some way in which the TabStop = False be respected for all Radiobuttons, regardless of Checked?

2 answers

4

The solution I found was to force the Tab or Shift + Tab at the Radiobuttons Onkeyup Event:

if (Key = VK_TAB) and (Shift = [ssShift]) then
begin
   Perform(WM_NEXTDLGCTL, 1, 0);
end
else if Key = VK_TAB then
begin
   Perform(WM_NEXTDLGCTL, 0, 0);
end;
  • 1

    Good morning Melissa.. damn. I never noticed that :) . Living and learning.. Cool your solution. On the other hand , testing this situation here I solved as follows: In the form ONSHOW I put all the Radiobuttons.tabstop:= False and in the onclick of each I put the same code Radiobutton1.Tabstop:= False. So it also works :) . Just another way to get a result :)

  • Cool! It is still in time for me to use a better solution, put your answer tb, depending on what is better, mark yours as accepted.

  • this my solution did not stay as expected, because it is made a "ghost Tab" and you can see, it bothers me a little yet

3


Testing this situation here I solved as follows:
In the ONSHOW form I put all the Radiobuttons.tabstop:= False
and on the onclick of each I put the same code Radiobutton1.Tabstop:= False.
That way it works too :) .
Just another way to get a result :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.