Groups | Blog | Home
all groups > vb.net > december 2004 >

vb.net : What's the best way to make a Terminal window?


Terry Olsen
12/12/2004 11:30:51 PM
I need to make a terminal window to emulate special characters of a vintage
PC. I don't think I can use a console because you can't change its
font...can you?

So what is the best way to make a terminal window that has a scrollback and
is easy to position the cursor? How does hyperterminal & SmartTerm do it?

Thanks!

Terry Olsen
12/13/2004 8:09:23 AM
A textbox is not easy when it comes to placing text at certain locations on
the screen.

[quoted text, click to view]

Leon Mayne [MVP]
12/13/2004 11:32:29 AM
[quoted text, click to view]

Presumably you can just use a multiline textbox, so you can set the
background, font colour etc as you like.

Tom Wilson
12/13/2004 2:55:02 PM
As Leon said, you
'll need to use a Panel and draw on it with GDI+. There are some examples in
the SDK documentation. Search for DrawString method.

If you're going to handle things like color and character attributes, then
you'll need to create a screen buffer. It should probably be done by creating
a matrix of characters:
dim ScreenBuffer(80,25)

and drawing this matrix to the screen one line at a time. To handle
atrributes and color, you can create an additional buffer:
dim ScreenColors(80,25)

Then, using DrawString in the panel's Paint event, you can draw each row and
column to the panel. To draw your cursor, just use the DrawBox method. Use a
timer set to 1000 or so to re-draw the cursor and make it blink.

There are ways to optimize this approach; but that's where I'd start. Once
you get the hang of how that works, you can try other ways of speeding things
up to get your text displayed faster (if it's necessary). Personally, I find
GDI to be slow, so I use OpenGL for graphic output. If I need text, I have a
library that creates text characters as OpenGL display lists.



[quoted text, click to view]
Terry Olsen
12/13/2004 3:26:47 PM
Gee...don't know. Never used GDI+. Is there a tutorial on it?


[quoted text, click to view]

Leon Mayne [MVP]
12/13/2004 3:56:45 PM
[quoted text, click to view]

That's true. I thought you might be working on a line by line basis.

Can you not use a panel and use GDI+ to place strings wherever you want on
the panel?

Cor Ligthert
12/14/2004 11:06:34 AM
Terry,

I cannot see what is wrong with Leons advise to use a textbox.

When that is in multiline mode.

With a toolbar wit toolbar buttons docked in top
And the textbox docked as fill

Than you can make in my opinion the nicest dialog windows as you want.

And the user can make it exactly in the size he wants by resizing his form.

Just my idea

Cor



"Terry Olsen" <tolsen64@hotmail.com> schreef in bericht
news:uzOGTLW4EHA.2196@TK2MSFTNGP14.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button