none
Fremy Extensions check box RRS feed

  • Question

  • I'm using Fremy's extension check box and I would like to start an event or some other action when checked but I'm not experienced enough in programming to figure it out. I have the following;

     'Create checkbox
      Qcb1 = Controls.AddCheckBox(File.ReadLine(Path + "\QItems.txt", 1,))
      Controls.Move(Qcb1, 8, 44)
      'Controls.SetChecked(Qcb1, "")
      Qcb2 = Controls.AddCheckBox(File.ReadLine(Path + "\QItems.txt", 2,))
      Controls.Move(Qcb2, 8, 64)
      'Controls.SetChecked(Qcb2, "False")
      Qcb3 = Controls.AddCheckBox(File.ReadLine(Path + "\QItems.txt", 3,))
      Controls.Move(Qcb3, 8, 84)
      'Controls.SetChecked(Qcb3, "False")

      If Qcb1 = "True" Then
        File.WriteLine (Path + "\QItemsList.txt", 1, "")
      endif
      If Qcb2 = "True" Then
        File.WriteLine (Path + "\QItemsList.txt", 2, "")
      endif
      If Qcb3 = "True" Then
        File.WriteLine (Path + "\QItemsList.txt", 3, "")
      endif

    I used textwindow.write (Qcb3) to show me the value and it returns "CheckBox3", Even if I set the Controls.Setchecked (Qcb3, "true") I cannot seem to get the variabiable Qcb3 to be "True", I would like to start an event if Qcb3 is "true", any help on how to do this is appreciated.
    Friday, September 11, 2009 4:06 PM

Answers

  • SFC-JMI

    I had a similar problem which Fremy kindly answered. Below is your code amended with the suggestion Fremy gave me.

    'Create checkbox
    Qcb1 = Controls.AddCheckBox(File.ReadLine(Path + "\QItems.txt", 1,))
    Controls.Move(Qcb1, 8, 44)
    'Controls.SetChecked(Qcb1, "")
    Qcb2 = Controls.AddCheckBox(File.ReadLine(Path + "\QItems.txt", 2,))
    Controls.Move(Qcb2, 8, 64)
    'Controls.SetChecked(Qcb2, "False")
    Qcb3 = Controls.AddCheckBox(File.ReadLine(Path + "\QItems.txt", 3,))
    Controls.Move(Qcb3, 8, 84)
    'Controls.SetChecked(Qcb3, "False")
    
    
    If Controls.GetChecked(Qcb1) = "True" Then
      File.WriteLine (Path + "\QItemsList.txt", 1, "")
    endif
    If controls.GetChecked(Qcb2) = "True" Then
      File.WriteLine (Path + "\QItemsList.txt", 2, "")
    endif
    If controls.GetChecked(Qcb3) = "True" Then
      File.WriteLine (Path + "\QItemsList.txt", 3, "")
    endif



    • Proposed as answer by SFC123 Friday, September 11, 2009 10:19 PM
    • Marked as answer by FremyCompany [MSFT] Saturday, September 12, 2009 4:17 PM
    Friday, September 11, 2009 9:01 PM

All replies

  • SFC-JMI

    I had a similar problem which Fremy kindly answered. Below is your code amended with the suggestion Fremy gave me.

    'Create checkbox
    Qcb1 = Controls.AddCheckBox(File.ReadLine(Path + "\QItems.txt", 1,))
    Controls.Move(Qcb1, 8, 44)
    'Controls.SetChecked(Qcb1, "")
    Qcb2 = Controls.AddCheckBox(File.ReadLine(Path + "\QItems.txt", 2,))
    Controls.Move(Qcb2, 8, 64)
    'Controls.SetChecked(Qcb2, "False")
    Qcb3 = Controls.AddCheckBox(File.ReadLine(Path + "\QItems.txt", 3,))
    Controls.Move(Qcb3, 8, 84)
    'Controls.SetChecked(Qcb3, "False")
    
    
    If Controls.GetChecked(Qcb1) = "True" Then
      File.WriteLine (Path + "\QItemsList.txt", 1, "")
    endif
    If controls.GetChecked(Qcb2) = "True" Then
      File.WriteLine (Path + "\QItemsList.txt", 2, "")
    endif
    If controls.GetChecked(Qcb3) = "True" Then
      File.WriteLine (Path + "\QItemsList.txt", 3, "")
    endif



    • Proposed as answer by SFC123 Friday, September 11, 2009 10:19 PM
    • Marked as answer by FremyCompany [MSFT] Saturday, September 12, 2009 4:17 PM
    Friday, September 11, 2009 9:01 PM
  • Thanks dhester,
    That works fine, I didn't know about controls.getchecked.

    Thanks for your help!
    Friday, September 11, 2009 10:18 PM