Loading ...
Sorry, an error occurred while loading the content.

Re: [libertybasic] RE: Statictext color

Expand Messages
  • Stefan Pendl
    ... The easiest is to have a border-less graphic box, with the background set to the color buttonface. Graphic boxes are easy to handle colored text, any other
    Message 1 of 6 , Sep 19, 2013
    • 0 Attachment
      Am 19.09.2013 21:52, schrieb hjohnc@...:
      >
      >
      > Thanks for the help. The 'ForegroundColor$' variable may do most of the
      > job I want.
      >
      >
      > Ideally I would like to change just one statictext label in a window
      > that has six such labels. The 'ForegroundColor$' solution is all or
      > nothing.
      >

      The easiest is to have a border-less graphic box, with the background
      set to the color buttonface.

      Graphic boxes are easy to handle colored text, any other control will
      need some API functions and a third party DLL.


      --
      Stefan Pendl
      http://stefanpendl.runbasichosting.com/

      LB 4.04 Pro ... http://www.libertybasic.com/assist.html
      LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

      LB Community Wiki .............. http://basic.wikispaces.com/
      LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
      LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

      Books at http://www.lulu.com/ and http://www.amazon.com/
      Alyce Watson ... APIs for Liberty BASIC
      Carl Gundel .... Beginning Programming with Liberty BASIC

      Windows 7 Home Premium 64-bit SP1
      AMD Turion X2 RM-70 2GHz, 4GB RAM
    • hjohnc1999
      ... The easiest is to have a border-less graphic box, with the background set to the color buttonface. Graphic boxes are easy to handle colored text, any other
      Message 2 of 6 , Sep 20, 2013
      • 0 Attachment

        Stefan -


        Thank you.  That sounds like my solution.  I will give it a try.


        John 



        --- In libertybasic@yahoogroups.com, <pendl2megabit@...> wrote:

        Am 19.09.2013 21:52, schrieb hjohnc@...:
        >
        >
        > Thanks for the help. The 'ForegroundColor$' variable may do most of the
        > job I want.
        >
        >
        > Ideally I would like to change just one statictext label in a window
        > that has six such labels. The 'ForegroundColor$' solution is all or
        > nothing.
        >

        The easiest is to have a border-less graphic box, with the background
        set to the color buttonface.

        Graphic boxes are easy to handle colored text, any other control will
        need some API functions and a third party DLL.


        --
        Stefan Pendl
        http://stefanpendl.runbasichosting.com/

        LB 4.04 Pro ... http://www.libertybasic.com/assist.html
        LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

        LB Community Wiki .............. http://basic.wikispaces.com/
        LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
        LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

        Books at http://www.lulu.com/ and http://www.amazon.com/
        Alyce Watson ... APIs for Liberty BASIC
        Carl Gundel .... Beginning Programming with Liberty BASIC

        Windows 7 Home Premium 64-bit SP1
        AMD Turion X2 RM-70 2GHz, 4GB RAM
      • Stefan Pendl
        ... John, below find a simple demo, with memory management. ---code start (watch for line wraps) NoMainWin UpperLeftX=int((DisplayWidth-WindowWidth)/2)
        Message 3 of 6 , Sep 21, 2013
        • 0 Attachment
          Am 20.09.2013 13:06, schrieb hjohnc@...:
          >
          >
          > Stefan -
          >
          >
          > Thank you. That sounds like my solution. I will give it a try.
          >

          John,

          below find a simple demo, with memory management.


          '---code start (watch for line wraps)

          NoMainWin
          UpperLeftX=int((DisplayWidth-WindowWidth)/2)
          UpperLeftY=int((DisplayHeight-WindowHeight)/2)

          color$(1) = "black"
          color$(2) = "red"
          color$(3) = "green"
          color$(4) = "blue"

          Stylebits #m.g, 0, _WS_BORDER, 0, 0
          Graphicbox #m.g, 10, 10, 200, 25

          button #m.btn, "Click Me", [ChangeColor], ul, 50, 50

          Open "Colored Text" for window as #m
          #m "Trapclose [quit]"

          #m.g "down"
          #m.g "fill buttonface"
          #m.g "flush backGround"

          #m.g "backcolor buttonface"
          #m.g "\\Change text color!"
          #m.g "flush nextColor"

          Wait

          [ChangeColor]
          CurrentColor = CurrentColor - 1
          if CurrentColor < 1 then CurrentColor = 4

          #m.g "delsegment nextColor"
          #m.g "color "; color$(CurrentColor)
          #m.g "place 0 0"
          #m.g "\\Change text color!"
          #m.g "flush nextColor"
          wait

          [quit]
          Close #m
          End

          '---code end

          --
          Stefan Pendl
          http://stefanpendl.runbasichosting.com/

          LB 4.04 Pro ... http://www.libertybasic.com/assist.html
          LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

          LB Community Wiki .............. http://basic.wikispaces.com/
          LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
          LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

          Books at http://www.lulu.com/ and http://www.amazon.com/
          Alyce Watson ... APIs for Liberty BASIC
          Carl Gundel .... Beginning Programming with Liberty BASIC

          Windows 7 Home Premium 64-bit SP1
          AMD Turion X2 RM-70 2GHz, 4GB RAM
        Your message has been successfully submitted and would be delivered to recipients shortly.