PowerTCP Emulation for .NET
AnsiColor Property
Example 




Provides fine control of display colors. Includes eight "normal" and eight "bold" (aka "bright" or "light") colors.
Syntax
Public Property AnsiColor As AnsiColor
Dim instance As Vt
Dim value As AnsiColor
 
instance.AnsiColor = value
 
value = instance.AnsiColor
public AnsiColor AnsiColor {get; set;}
public: __property AnsiColor* get_AnsiColor();
public: __property void set_AnsiColor( 
   AnsiColor* value
);
public:
property AnsiColor^ AnsiColor {
   AnsiColor^ get();
   void set (    AnsiColor^ value);
}
Example
The following example demonstrates how set normal colors as an intensity percentage of bold colors.
private void updateColors(Vt vt, int intensity)
{
    //Update colors to a specified intensity (0-100).
    //0 is black and 100 is the bold color.
    int val = ((255 * intensity) / 100);
    vt.AnsiColor.BlackBold = Color.Gray;
    vt.AnsiColor.RedBold = Color.Red;
    vt.AnsiColor.GreenBold = Color.Lime;
    vt.AnsiColor.YellowBold = Color.Yellow;
    vt.AnsiColor.BlueBold = Color.Blue;
    vt.AnsiColor.MagentaBold = Color.Magenta;
    vt.AnsiColor.CyanBold = Color.Cyan;
    vt.AnsiColor.WhiteBold = Color.White;
    vt.AnsiColor.Black = Color.Black;
    vt.AnsiColor.Red = Color.FromArgb(val, 0, 0);
    vt.AnsiColor.Green = Color.FromArgb(0, val, 0);
    vt.AnsiColor.Yellow = Color.FromArgb(val, val, 0);
    vt.AnsiColor.Blue = Color.FromArgb(0, 0, val);
    vt.AnsiColor.Magenta = Color.FromArgb(val, 0, val);
    vt.AnsiColor.Cyan = Color.FromArgb(0, val, val);
    vt.AnsiColor.White = Color.FromArgb(val, val, val);
    vt.Refresh();
}
Private Sub updateColors(ByVal vt As Vt, ByVal intensity As Integer)
    'Update colors to a specified intensity (0-100).
    '0 is black and 100 is the bold color.
    Dim val As Integer = ((255 * intensity) / 100)
    vt.AnsiColor.BlackBold = Color.Gray
    vt.AnsiColor.RedBold = Color.Red
    vt.AnsiColor.GreenBold = Color.Lime
    vt.AnsiColor.YellowBold = Color.Yellow
    vt.AnsiColor.BlueBold = Color.Blue
    vt.AnsiColor.MagentaBold = Color.Magenta
    vt.AnsiColor.CyanBold = Color.Cyan
    vt.AnsiColor.WhiteBold = Color.White
    vt.AnsiColor.Black = Color.Black
    vt.AnsiColor.Red = Color.FromArgb(val, 0, 0)
    vt.AnsiColor.Green = Color.FromArgb(0, val, 0)
    vt.AnsiColor.Yellow = Color.FromArgb(val, val, 0)
    vt.AnsiColor.Blue = Color.FromArgb(0, 0, val)
    vt.AnsiColor.Magenta = Color.FromArgb(val, 0, val)
    vt.AnsiColor.Cyan = Color.FromArgb(0, val, val)
    vt.AnsiColor.White = Color.FromArgb(val, val, val)
    vt.Refresh()
End Sub
See Also

Reference

Vt Class
Vt Members


PowerTCP Emulation for .NET Documentation Version 4.7
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic