none
how to color a graphic.Controls.AddTextBox RRS feed

  • Question

  • Here is what i try to do,

    i have a 20 boxez in wich numbers will be enter in.

    the background color surrounding those boxes is darkblue.

    but, by default, small basic draw boxes  in white.

    i want to have it gray.  HOW ?

    here is the code:

    GraphicsWindow.Clear()                
    GraphicsWindow.Title = "Calculators"
    GraphicsWindow.top= 0
    GraphicsWindow.left= 0
    GraphicsWindow.Height = 768
    GraphicsWindow.Width = 1366
    GraphicsWindow.BackgroundColor ="darkblue"

    For t=1 to 20

      area[t] = Controls.AddTextBox (200, 50+x)
                    Controls.SetTextBoxText (area[t],0)

    x=x+25

    endfor

    THANKS !!!!

    Monday, February 29, 2016 11:02 PM
    Answerer

Answers

  • Here's a way you could do it without extension:

    GraphicsWindow.FillRectangle(10, 10, 70, 25)
    tBox = Controls.AddTextBox(10 10)
    Controls.SetSize(tBox, 70, 25)
    Shapes.SetOpacity(tBox, 70)


    Tuesday, March 1, 2016 5:28 AM
    Moderator
  • Not without an extension I think.  With the LitDev extension you can do:

    GraphicsWindow.Clear()                
    GraphicsWindow.Title = "Calculators"
    GraphicsWindow.top= 0
    GraphicsWindow.left= 0
    GraphicsWindow.Height = 768
    GraphicsWindow.Width = 1366
    GraphicsWindow.BackgroundColor ="darkblue"
    
    For t=1 to 20
      
      area[t] = Controls.AddTextBox (200, 50+x)
      LDShapes.BrushColour(area[t],"Gray")
      Controls.SetTextBoxText (area[t],0)
      
      x=x+25
      
    endfor

    Monday, February 29, 2016 11:06 PM
    Moderator

All replies

  • Not without an extension I think.  With the LitDev extension you can do:

    GraphicsWindow.Clear()                
    GraphicsWindow.Title = "Calculators"
    GraphicsWindow.top= 0
    GraphicsWindow.left= 0
    GraphicsWindow.Height = 768
    GraphicsWindow.Width = 1366
    GraphicsWindow.BackgroundColor ="darkblue"
    
    For t=1 to 20
      
      area[t] = Controls.AddTextBox (200, 50+x)
      LDShapes.BrushColour(area[t],"Gray")
      Controls.SetTextBoxText (area[t],0)
      
      x=x+25
      
    endfor

    Monday, February 29, 2016 11:06 PM
    Moderator
  • Here's a way you could do it without extension:

    GraphicsWindow.FillRectangle(10, 10, 70, 25)
    tBox = Controls.AddTextBox(10 10)
    Controls.SetSize(tBox, 70, 25)
    Shapes.SetOpacity(tBox, 70)


    Tuesday, March 1, 2016 5:28 AM
    Moderator
  • Nice one JJ - I forgot about this way.
    Tuesday, March 1, 2016 6:51 PM
    Moderator
  • GREAT NONKI !!!! FANTASTIC SOLUTION.  THANKS !! SO MUCH

    Here is the final code:


    GraphicsWindow.Clear()                
    GraphicsWindow.Title = "Calculators
    GraphicsWindow.top= 0
    GraphicsWindow.left= 0
    GraphicsWindow.Height = 768
    GraphicsWindow.Width = 1366
    GraphicsWindow.BackgroundColor ="darkblue"

    ' credit card purchases
        GraphicsWindow.BrushColor = "red"
        GraphicsWindow.FontSize = 15
        GraphicsWindow.DrawBoundText(425, 325, 450, "Credit Card")
        GraphicsWindow.BrushColor = "black"
        GraphicsWindow.FontSize = 15
        'Proposed as answer by Nonki

     GraphicsWindow.FillRectangle(600, 325, 160, 25)
    tBox = Controls.AddTextBox(600 325)
    Controls.SetSize(tBox, 160, 25)
    Shapes.SetOpacity(tBox, 70)

    mastercard=(122.45)
                    Controls.SetTextBoxText(tBox,mastercard)

      


    • Edited by YLedEditor Tuesday, March 1, 2016 11:41 PM forgot to add the amount
    Tuesday, March 1, 2016 11:39 PM
    Answerer