• Welcome to Valhalla Legends Archive.
 

picBox

Started by Lenny, July 01, 2003, 11:24 PM

Previous topic - Next topic

Lenny

One of my first programs was a chat bot for networks....

It had a timer that would open a text file once every 100 ms and a send box that would save to this text file.....This text file would be shared on the network so the text file thus would act like a Channel

........it still is a project I am working on.....
Can anyone tell me how to fix one big problem....The picture box that displays the text doesnt scroll down when it becomes full, any ideas on how to fix this?....
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Noodlez

Yes. Don't use a picturebox to display text.

Grok

1.  Instead of just writing the person's name and the text to a file, write a timestamp (sequential number), the person's name, and the text in a delimited file.  When reading back the file, you only need read what was added since the last timestamp you remember.


52348, TinyTim, my stupid dog ate my homework
52349, MorChiken, hahaha you'll get detention
52350, TinyTim, shutup and let me copy yours
52351, Bubbles, is Sarah in here?

Have each client remember the timestamp of the data it last displayed.  When it goes back to read the file again, read up to the previous timestamp, then start displaying new lines.

2.  Display all your lines in a control like a textbox, listbox, or much easier is to use a RichTextBox control.  Set ScrollBars to Vertical in the properties box.  Turn on Text Wrapping, and set a reasonable margin.

This should be enough info to get your started.  After you get more experience, the people on these boards can help you make the chat program even more interactive.

But not yet.  Go ahead and continue on your current approach.  You'll really enjoy the advanced methods later!

DarkMinion

QuoteYes. Don't use a picturebox to display text.

Blizzard does in Starcraft/War2/Diablo  :P

Skywing

Quote from: DarkMinion on July 02, 2003, 07:39 AM
QuoteYes. Don't use a picturebox to display text.

Blizzard does in Starcraft/War2/Diablo  :P
Ehh.. last time I checked, Blizzard didn't write Starcraft/War2/Diablo in VB.

DarkMinion

Shhh

They still use a picturebox  :P

Camel

Quote from: Skywing on July 02, 2003, 03:17 PM
Quote from: DarkMinion on July 02, 2003, 07:39 AM
QuoteYes. Don't use a picturebox to display text.

Blizzard does in Starcraft/War2/Diablo  :P
Ehh.. last time I checked, Blizzard didn't write Starcraft/War2/Diablo in VB.

You never know, terms are subject to change without notification!

j0k3r

Wouldn't that require a huge patch though?

Back to the post subject... Lenny I have/had a book that dealt this, there is something you need to enable or add. If I find it I will post as soon as I can.
QuoteAnyone attempting to generate random numbers by deterministic means is, of course, living in a state of sin
John Vo

Lenny

#8
thx
I dont want to add a RCT box because I want all the code to be written by me...
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.