阅读:2175回复:0
如何使用RadioButton修改注册表?
需要实现选择RadioButton1时注册表HKEY_LOCAL_MACHINE\SOFTWARE\SDR\user值为0
选择RadioButton2时注册表HKEY_LOCAL_MACHINE\SOFTWARE\SDR\user值为1,应该如何修改? [CustomMessages] CustomForm_Caption=CustomForm Caption CustomForm_Description=CustomForm Description CustomForm_RadioButton1_Caption0=RadioButton1 CustomForm_RadioButton2_Caption0=RadioButton2 [Code] var RadioButton1: TRadioButton; RadioButton2: TRadioButton; { CustomForm_Activate } procedure CustomForm_Activate(Page: TWizardPage); begin // enter code here... end; { CustomForm_ShouldSkipPage } function CustomForm_ShouldSkipPage(Page: TWizardPage): Boolean; begin Result := False; end; { CustomForm_BackButtonClick } function CustomForm_BackButtonClick(Page: TWizardPage): Boolean; begin Result := True; end; { CustomForm_NextkButtonClick } function CustomForm_NextButtonClick(Page: TWizardPage): Boolean; begin Result := True; end; { CustomForm_CancelButtonClick } procedure CustomForm_CancelButtonClick(Page: TWizardPage; var Cancel, Confirm: Boolean); begin // enter code here... end; { CustomForm_CreatePage } function CustomForm_CreatePage(PreviousPageId: Integer): Integer; var Page: TWizardPage; begin Page := CreateCustomPage( PreviousPageId, ExpandConstant('{cm:CustomForm_Caption}'), ExpandConstant('{cm:CustomForm_Description}') ); { RadioButton1 } RadioButton1 := TRadioButton.Create(Page); with RadioButton1 do begin Parent := Page.Surface; Caption := ExpandConstant('{cm:CustomForm_RadioButton1_Caption0}'); Left := ScaleX(136); Top := ScaleY(40); Width := ScaleX(113); Height := ScaleY(17); TabOrder := 0; end; { RadioButton2 } RadioButton2 := TRadioButton.Create(Page); with RadioButton2 do begin Parent := Page.Surface; Caption := ExpandConstant('{cm:CustomForm_RadioButton2_Caption0}'); Left := ScaleX(136); Top := ScaleY(80); Width := ScaleX(113); Height := ScaleY(17); TabOrder := 1; end; with Page do begin OnActivate := @CustomForm_Activate; OnShouldSkipPage := @CustomForm_ShouldSkipPage; OnBackButtonClick := @CustomForm_BackButtonClick; OnNextButtonClick := @CustomForm_NextButtonClick; OnCancelButtonClick := @CustomForm_CancelButtonClick; end; Result := Page.ID; end; { CustomForm_InitializeWizard } procedure InitializeWizard(); begin CustomForm_CreatePage(wpWelcome); end; |
|