Scrollbars in VB

Discussions on Software that do not yet fit into any of the current Software fora.

Moderator: Software Moderators

Scrollbars in VB

Postby Ben Last » Sat 2005 Apr 09 2:12

Hi, I have a problem in VB6.

I am trying to make a small VB application which allows two or more users to chat.
I am displaying the text conversation in a textbox, with a vertical scrollbar.

The newest text is added onto the bottom of the existing text, but the scrollbar always returns to the top when updating the field, which is not handy as the user has to continously scroll down to read the newest text.

I am looking for a way to set the position of the scrollbar to the bottom, to remove this problem.

I have found that it's possible to set the position of a standalone scrollbar using 'VScrollBar.Value', but this doesn't seem possible on a textbox with combined scrollbar, all I can find is 'Text1.ScrollBars' which only seems to let me set Horiz/Vert/Both Scrollbars.

The only other idea I had was to set the cursor position in the text manualy to the last line somewhere, but I don't know how I would calculate how many characters are present so I know what value to set the cursor at. Although this might work I would prefer the first idea as it seems much more straight forward.


Also, I am transferring the text between machines using a plain text file, is there a better way of transferring data between machines across a network which isn't too compilcated, as I'm not very advanced!

Can anyone help?
Thanks, Ben.
No trees were harmed in the construction of this message, however many electrons were terribly inconvenienced.
User avatar
Ben Last
Consulting Ambassador
Consulting Ambassador
 
Posts: 475
Joined: Fri 2005 Jan 21 7:47
Location: Stowmarket

Postby Spock » Sat 2005 Apr 09 4:11

I am in the midst of doing taxes, so shouldn't even be in here but will take a look at you problem in depth as soon as I can.

In the mean time, why do this when there are already many ways available to chat on a LAN already? Are you doing this as a self exercise in how to program for a network or is there some other requirement?

Without doing any research my immediate suggestion would be to have the most recent "post" on top rather than the bottom. It might help solve one problem anyway... [;)]
User avatar
Spock
Forum Admin
Forum Admin
 
Posts: 2417
Joined: Tue 2005 Jan 18 10:47
Location: MD, USA

Postby Ben Last » Sat 2005 Apr 09 8:06

I suppose I'm just doing it so I can I say I have really, although if it works well enough I may use it.
The project is very similar to one I nearly finished back in QBasic, but somehow messed it up in the final stages. I just thought it would be interesting to find a bit more out about visual basic as Im using VBA in my studies.
No trees were harmed in the construction of this message, however many electrons were terribly inconvenienced.
User avatar
Ben Last
Consulting Ambassador
Consulting Ambassador
 
Posts: 475
Joined: Fri 2005 Jan 21 7:47
Location: Stowmarket

Postby Spock » Sat 2005 Apr 09 10:16

If you were using VB.Net I might even be able to help a little. I don't have VB6 and never worked with it.

I was going to do research on VB.Net to see if I could find an answer there. Although they don't seem to have VB6, you might try C# Corner Forums They cover a lot of other information, including VB.Net.

Here is an article about there still being support for VB6 and here is some VB6 support by users.

I cannot tell if Advanced String Handling for Visual Basic and VB.NET is actually an advertisement trying to get you to buy something or if it is actually something useful. They do have a download link but I didn't click on it.

Finally, here are a few links I have saved over time:
VB Developers Center

Programmer's Heaven - This has lots of source code that may help.

Planet Source Code - as does this.

Hope this helps.
User avatar
Spock
Forum Admin
Forum Admin
 
Posts: 2417
Joined: Tue 2005 Jan 18 10:47
Location: MD, USA


Return to General SW

Who is online

Users browsing this forum: No registered users and 1 guest

cron