size : 767
uploaded_on : Wed Oct 14 00:00:00 1998
modified_on : Wed Dec 8 14:03:17 1999
title : Help context
org_filename : HlpContext.txt
author : Ralph Friedman
authoremail :
description : Help context in groups
keywords :
tested : not tested yet
submitted_by : Mike Orriss
submitted_by_email : mjo@3kcc.co.uk
uploaded_by : nobody
modified_by : nobody
owner : nobody
lang : plain
file-type : text/plain
category : delphi-system32bit
__END_OF_HEADER__
>> I have a radio group on a form. I would like to call context sensitive help when a user presses F1. I have set the HelpContext equal to 22 for this particular radio group, but whenever I ask for ActiveControl.HelpContext it returns zero (0). All of the other controls work just fine. Am I doing something wrong? <<
No. The problem is that the ActiveControl is the RadioButton not the RadioButtonGroup. Put the following code in OnShow event handler for your form and it should solve your problem:
procedure TForm1.FormShow(Sender: TObject);
var
c: integer;
begin
with RadioGroup1 do begin
for c := 0 to ControlCount - 1 do
TRadioButton(Controls[c]).HelpContext := HelpContext;
end;
end;
- Ralph Friedman