473,404 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Setting Console Colors

I am working on a console app with VB .NET 2003. I would
like to change the color of the output stream (like the
old COLOR command in QBasic) but have not found anything
on MSDN. After searching the web I found how to do it
with VB 6.0 (using the SetConsoleTextAttribute function
in the "kernel32" Lib) but I assume there is a "clean"
and preferred way of doing it using the VB .NET
System.Console namespace.

Any ideas?
Nov 20 '05 #1
2 1613
Stephen Becker wrote:
I am working on a console app with VB .NET 2003. I would
like to change the color of the output stream (like the
old COLOR command in QBasic) but have not found anything
on MSDN. After searching the web I found how to do it
with VB 6.0 (using the SetConsoleTextAttribute function
in the "kernel32" Lib) but I assume there is a "clean"
and preferred way of doing it using the VB .NET
System.Console namespace.

Any ideas?


Nope. Have to use P/Invoke for it. Since you already have the
necessary API call - then my work is done here :)

Tom Shelton

Nov 20 '05 #2
Hello,

"Stephen Becker" <st*****@beckerdomain.com> schrieb:
I am working on a console app with VB .NET 2003. I would
like to change the color of the output stream (like the
old COLOR command in QBasic) but have not found anything
on MSDN. After searching the web I found how to do it
with VB 6.0 (using the SetConsoleTextAttribute function
in the "kernel32" Lib) but I assume there is a "clean"
and preferred way of doing it using the VB .NET
System.Console namespace.


There is no managed way to do what you want.

http://www.mentalis.org/soft/class.qpx?id=2

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: Dom | last post by:
can someone please help me display text in the console cout << "Testing"; in a different colour to the default one
2
by: Martín Marconcini | last post by:
Hello there, I'm writting (or trying to) a Console Application in C#. I has to be console. I remember back in the old days of Cobol (Unisys), Clipper and even Basic, I used to use a program...
5
by: Publicjoe | last post by:
I am working on a little app which uses colour in the console window. I have created a class to extend the console functionality but the ClearScreen method does not work correctly. I am enclosing a...
1
by: James | last post by:
I write a console.exe program using vb.net 2003. How do i add colors into it for particular text eg line 1 is red color ? Eg console.writeline "line 1" console.writeline "line 2"
1
by: Demi | last post by:
I want to be able to define standard colors in a base form, then have child forms use those values instead of standard colors. Ex in my base form I want to do this: Color myColor =...
6
by: vijai.kalyan | last post by:
Hello, I wrote a trivial program to set the console title in a console application. Here is the code:- namespace myns { class SetTitle { static void Main ( string args )
8
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to set the color of a visited HyperLinkField (the link text) in a GridView?? Here is the markup of the HyperLinkField I have problems with: <asp:HyperLinkField...
2
by: =?Utf-8?B?UGFvbG8=?= | last post by:
I not e that with the Console class I can change foreground and background colours, for example. Is there a way to control other character attributes e.g. bold, bright, blinking? Or do I have to...
4
by: K Viltersten | last post by:
I've used the Colors class to access a bunch of colors for my applications. Now, i'd like to create a family for of each such color as follows. public Color Normal {get{return Colors.Orange;}}...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.