none
How do I change the font color in a Powershell form? RRS feed

  • Question

  • Hello Scripting Guys!

    I am back with another question for you. I am working on a form to create external contacts and have it complete. I am working validate the fields and have that almost complete. The issue is that while my "*" pop up for incorrect fields or fields that are not completed, I cant seem to find a way to change to font color to "RED".  I have seen online where they are talking about changing the entire forms font color but I only need a few things changed. Is there a way to specifically target a label and change the font color? Any help would be appreciate.

    Thanks again

    Rich

    Tuesday, June 30, 2015 5:42 PM

Answers

  • Hi,

    You are talking about this ? :

    -ForegroundColor Red

    For example :


    Cordialement,

    Mickaël LOPES

    Blog : http://lopes.im 

      

    • Marked as answer by Richardlaw Tuesday, June 30, 2015 6:27 PM
    Tuesday, June 30, 2015 6:00 PM
  •     $textbox1.ForeColor='yellow'
        $textbox1.BackColor='darkblue'

    \_(ツ)_/

    • Proposed as answer by Mike Laughlin Tuesday, June 30, 2015 6:26 PM
    • Marked as answer by Richardlaw Tuesday, June 30, 2015 6:27 PM
    Tuesday, June 30, 2015 6:15 PM

All replies

  • Hi,

    You are talking about this ? :

    -ForegroundColor Red

    For example :


    Cordialement,

    Mickaël LOPES

    Blog : http://lopes.im 

      

    • Marked as answer by Richardlaw Tuesday, June 30, 2015 6:27 PM
    Tuesday, June 30, 2015 6:00 PM
  •     $textbox1.ForeColor='yellow'
        $textbox1.BackColor='darkblue'

    \_(ツ)_/

    • Proposed as answer by Mike Laughlin Tuesday, June 30, 2015 6:26 PM
    • Marked as answer by Richardlaw Tuesday, June 30, 2015 6:27 PM
    Tuesday, June 30, 2015 6:15 PM
  • Thanks guys they both work like a charm!
    Tuesday, June 30, 2015 6:27 PM
  • Lopes,

    Your examples put some how close to what I want to accomplish within Oracle SQL(sqlprompt) as I explain in

    this: https://social.technet.microsoft.com/Forums/en-US/3a712507-4445-464f-9683-6433907104b8/how-2-color-ur-sqlprompt-4-oracle-loginsql-powershell-windows?forum=ITCG

    If I can get some light on how to call the "write-host....-ForegroundColor..."  function within oracle/sql or similar

    I'll figure out the rest. Thanks in advance for any light on this.

    Cheers

    Alf

    Wednesday, January 20, 2016 9:35 PM
  • Lopes,

    Your examples put some how close to what I want to accomplish within Oracle SQL(sqlprompt) as I explain in

    this: https://social.technet.microsoft.com/Forums/en-US/3a712507-4445-464f-9683-6433907104b8/how-2-color-ur-sqlprompt-4-oracle-loginsql-powershell-windows?forum=ITCG

    If I can get some light on how to call the "write-host....-ForegroundColor..."  function within oracle/sql or similar

    I'll figure out the rest. Thanks in advance for any light on this.

    Cheers

    Alf


    This topic is closed for a long time.  Post Oracle issues in the Oracle forum.  THisi s not an Oracle forum and cannot give you instructions on how to use Oracle SQL*Plus.

    \_(ツ)_/

    Wednesday, January 20, 2016 11:23 PM
  • Ok here we go with the AS@$#$@# answer(s).... The guru/experts that actually gives answer r rate. JRV if you actually read the case, you'll see is not an Oracle issue. I'm just trying to make Windows/Powershell look good by learning how to call/pass a value from the OS function level to within sqlplus prompt... and show case within my group...but again thanks for your guidance.

    Thanks for advising on the tread/topic being close I did missed that... I guess I'm the ignorant that know little, then, this makes you the ignorant that knows a lot... cheers mate.

    It's just 0s and 1s no hard feelings.

    Wednesday, January 20, 2016 11:47 PM
  • Ok here we go with the AS@$#$@# answer(s).... The guru/experts that actually gives answer r rate. JRV if you actually read the case, you'll see is not an Oracle issue. I'm just trying to make Windows/Powershell look good by learning how to call/pass a value from the OS function level to within sqlplus prompt... and show case within my group...but again thanks for your guidance.

    Thanks for advising on the tread/topic being close I did missed that... I guess I'm the ignorant that know little, then, this makes you the ignorant that knows a lot... cheers mate.

    It's just 0s and 1s no hard feelings.

    I am sorry. I have used SQL*Plus for years and I have used PowerShell for years.  Your question cannot be answered as asked.  SQLPLus output cannot be colorized by PowerShell.  It is an external program. If you weren't such a decided a** you would post in the Oracle forum to learn how to call the OS from SQL*Plus.  There is a possibility that this can be made to work.

    In th past I have use ansi.sys and set SQL*Plus to output ansi so UI could get color.  There are now better methods in SQL*Plus to do this. Post in Oracle forum to find out how and if it is possible when running under PowerShell.

    Don't be a ditz.  You will never learn anything by insulting people.


    \_(ツ)_/

    Wednesday, January 20, 2016 11:58 PM
  • Ok here we go with the AS@$#$@# answer(s).... The guru/experts that actually gives answer r rate. JRV if you actually read the case, you'll see is not an Oracle issue. I'm just trying to make Windows/Powershell look good by learning how to call/pass a value from the OS function level to within sqlplus prompt... and show case within my group...but again thanks for your guidance.

    Thanks for advising on the tread/topic being close I did missed that... I guess I'm the ignorant that know little, then, this makes you the ignorant that knows a lot... cheers mate.

    It's just 0s and 1s no hard feelings.

    I should also note that this thread is totally unrelated to anything you are asking about.  Go back and carefully read the  question and the answer.

    If you are serius about how to use Forms to intercept and colorize output from external programs we can assist but you need to start you own thread with a clear description of what you are trying to do and a sample of your code.


    \_(ツ)_/

    Thursday, January 21, 2016 1:09 AM