Advertisement
Layth01

Untitled

Mar 30th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. unit ASTopicSelectionUnit;
  2.  
  3. interface
  4.  
  5. uses
  6. Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  7. Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
  8.  
  9. type
  10. TfrmASTopicSelect = class(TForm)
  11. lblTopics: TLabel;
  12. btnMitosis: TButton;
  13. btnExit: TButton;
  14. procedure btnExitClick(Sender: TObject);
  15. procedure btnMitosisClick(Sender: TObject);
  16. procedure FormCreate(Sender: TObject);
  17. private
  18. { Private declarations }
  19. public
  20. { Public declarations }
  21. end;
  22.  
  23. var
  24. frmASTopicSelect: TfrmASTopicSelect;
  25.  
  26.  
  27. implementation
  28.  
  29. {$R *.dfm}
  30.  
  31. Uses
  32. MitosisQuestionsUnit , StudentMenuUnit;
  33.  
  34. //Close the form - goes to student menu:
  35. procedure TfrmASTopicSelect.btnExitClick(Sender: TObject);
  36. begin
  37. frmASTopicSelect.Close;
  38. frmStudentMenu.Show;
  39. end;
  40.  
  41.  
  42. procedure TfrmASTopicSelect.btnMitosisClick(Sender: TObject);
  43. begin
  44. //open mitosis questions:
  45. frmMitosisQuestions.Show;
  46. frmASTopicSelect.Hide;
  47.  
  48. //Reset the radio group selections:
  49. frmMitosisQuestions.rgrpQuestion1.ItemIndex := -1;
  50. frmMitosisQuestions.rgrpQuestion2.ItemIndex := -1;
  51. frmMitosisQuestions.rgrpQuestion3.ItemIndex := -1;
  52. frmMitosisQuestions.rgrpQuestion4.ItemIndex := -1;
  53.  
  54. frmMitosisQuestions.btnSubmit.Enabled := True;
  55.  
  56.  
  57. //make the answers invisible
  58. frmMitosisQuestions.lblAnswer1.Visible := False;
  59. frmMitosisQuestions.lblAnswer2.Visible := False;
  60. frmMitosisQuestions.lblAnswer3.Visible := False;
  61. frmMitosisQuestions.lblAnswer4.Visible := False;
  62.  
  63. end;
  64.  
  65. procedure TfrmASTopicSelect.FormCreate(Sender: TObject);
  66. begin
  67. //disables close button (top-right corner):
  68. EnableMenuItem( GetSystemMenu( handle, False ),SC_CLOSE, MF_BYCOMMAND or MF_GRAYED );
  69. end;
  70.  
  71. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement