How to enable RadioButton when text is Scrolled down?

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
flho_fvr
Posts: 6
Joined: Mon Feb 03, 2020 12:22 am

How to enable RadioButton when text is Scrolled down?

Post by flho_fvr »

Hi

The following works like a charm... but I would like the radiobuttons to be greyed out, until the user has scrolled to the bottom of the text... just cant seem to find an event matching this?

Any ideas?
  1. $myText = @"
  2.  
  3.    Start of my very long license notice ....
  4.  
  5.    ---- end of the notice."@
  6.  
  7.  
  8.  
  9. $form1_Load = {
  10.  
  11.     #$radiobuttonIaccept.Enabled = $false
  12.  
  13.     #$radiobuttonIdoNotAccept.Enabled = $false
  14.  
  15.     $buttonNext.Enabled = $false
  16.  
  17.     Update-Text
  18.  
  19. }
  20.  
  21.  
  22.  
  23. $buttonExit_Click={
  24.  
  25.     $form1.Close()
  26.  
  27. }
  28.  
  29.  
  30.  
  31. function Update-Text
  32.  
  33. {
  34.  
  35.     $richtextbox1.Text = $myText
  36.  
  37. }
  38.  
  39.  
  40.  
  41. $radiobuttonIaccept_CheckedChanged={
  42.  
  43.     $buttonNext.Enabled = $true
  44.  
  45. }
  46.  
  47.  
  48.  
  49. $radiobuttonIdoNotAccept_CheckedChanged={
  50.  
  51.     $buttonNext.Enabled = $false
  52.  
  53. }
  54.  
  55.  
  56.  
  57.  
  58.  
  59. $buttonNext_Click={
  60.  
  61.     $Script:acceptLicense = $true
  62.  
  63.     $form1.Close()
  64.  
  65. }
Best regards
/Flemming

jvierra
Posts: 14452
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: How to enable RadioButton when text is Scrolled down?

Post by jvierra »

Here is one way to do this.
Attachments
VScroll-Test.psf
(311.89 KiB) Downloaded 27 times

flho_fvr
Posts: 6
Joined: Mon Feb 03, 2020 12:22 am

Re: How to enable RadioButton when text is Scrolled down?

Post by flho_fvr »

Hi jvierra

Thanks for your quick reply - had worked it out, and it works like a charm :)

Best regards
/Flemming

Locked