C
ChrisUttenreither
Hello folks. I'm writing a Roguelike game in C#. Fun stuff. The game
includes a map that is made entirely of colored ASCII art in a
monospace font. I would like to make this map a control in the main
form.
My first attempt was with RichTextBox. I wanted to set the background
to black. After cruising newsgroups I determined that wasn't possible.
My second attempt involves an AxSHDocVw.AxWebBrowser control. I got
this by adding the "Microsoft Web Browser" control to my Toolbox. This
control does not play nicely with the rest of my form! It constantly
steals focus for itself, and there isn't a reliable mechanism for
forcing my main form to have focus. Since that control is not set up
to handle keyboard events (this is how the player moves through the
map) other people on newsgroups have been told to write an unmanaged
DLL that snags a (global?) hook and signals my application when
keyboard input has been entered.
That seems awfully complicated. A wise software engineer once told me
when a solution seems inordinately complex that I should ask if there's
a better solution. So that's the purpose of my message.
I want to
display multicolored text in a form control. I want to be able to
change the background as well as the foreground, and I want to be able
to acquire keyboard input without writing a bunch of low level code.
What is the best solution? What is the best control to use? I am
using .NET 1.0.
Thanks!
includes a map that is made entirely of colored ASCII art in a
monospace font. I would like to make this map a control in the main
form.
My first attempt was with RichTextBox. I wanted to set the background
to black. After cruising newsgroups I determined that wasn't possible.
My second attempt involves an AxSHDocVw.AxWebBrowser control. I got
this by adding the "Microsoft Web Browser" control to my Toolbox. This
control does not play nicely with the rest of my form! It constantly
steals focus for itself, and there isn't a reliable mechanism for
forcing my main form to have focus. Since that control is not set up
to handle keyboard events (this is how the player moves through the
map) other people on newsgroups have been told to write an unmanaged
DLL that snags a (global?) hook and signals my application when
keyboard input has been entered.
That seems awfully complicated. A wise software engineer once told me
when a solution seems inordinately complex that I should ask if there's
a better solution. So that's the purpose of my message.

display multicolored text in a form control. I want to be able to
change the background as well as the foreground, and I want to be able
to acquire keyboard input without writing a bunch of low level code.
What is the best solution? What is the best control to use? I am
using .NET 1.0.
Thanks!