How to implement a Visual Studio like Output window

D

davidpryce123

Hi

I am an XLib programmer making a move to Windows and C#.

To learn as much as I can I am planning to convert a program basic
program
across from XLib.

I have spent the last few days with my head in Windows forms manual
and learnt alot.

In my application I wish to have a window similar to the output window
in Visual Studio.

How is the output window in Visual stuido implemented?

Is it a giant text box or it is a special window?

How can I make a simple console like output window in a windows
application?

Thanks

David
 
N

not_a_commie

Use a textBox or a richTextBox. I do that in my application. I have a
synchronized queue that collects messages from all threads and a timer
that prints them 30 times / second. I concatenate all the messages
using StringBuilder. Then if my new text.Len + existing text.Len is
greater than current amount of allowed text in the box I chop off the
first 1/3 of the existing text before appending.
 
D

davidpryce123

Hi Group,

I have implemented a log using a textbox.

In this log I insert my log messaage to the end of the text box.

I have attached ScrollBars.Vertical to the text box.

However the scroll bar is always at the top, so as I continue adding
to the
log the most recent events are off the bottom of the screen.

How do I modify the scrollbars so it is at the bottom and the oldest
text at the top goes off the screen and I need to scroll to see it.

Thanks

David
 
I

Ian Semmel

It's easier to log to a ListBox and as you log each message set the item to
SetSelected. The scrolling is done automatically.
 
D

davidpryce123

Hi
It's easier to log to a ListBox and as you log each message set the item to
SetSelected. The scrolling is done automatically.

If I use a listbox is it possible for the user to select part of the
text and copy to NOTEPAD etc?

I wish to be able to select some of the text if it is interesting in
the log.

Why does the scrolling work correctly for the listbox and not the text
box?

David
 
I

Ian Semmel

I'm not sure if you can select text from a listbox.

If you have an edit box and say it is multiline and check the Scrollbars
option, doesn't it add the scrollbars for you?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top