It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Text Box

Moderator: dafunkymunky

Text Box

Postby ssShotguNnn on Thu Oct 07, 2004 11:01 am

I need help on this as i have been stuck on this for a while

I am making a private chat program for me and a friend to connect directly. In the program is a text box to show the messages obviously.
Now what I want is either the text box automaticly scrolls down or it deletes all the messages when it reaches a certain length of characters but before it deletes the messages it saves them to a .txt file for future reference.

All help is welcome!
ssShotguNnn
 
Posts: 2
Joined: Thu Oct 07, 2004 10:56 am

the solution is

Postby techyashish on Thu Oct 07, 2004 11:03 pm

:D

hi the mulltiline feature of textbox can be set to true to solve this problem and if u want to save the messages in a text file . then put a option there
and use filesystem object to save it to some text file


regards

ashish
techyashish
 
Posts: 10
Joined: Wed Oct 06, 2004 6:27 pm
Location: toronto

Postby ssShotguNnn on Sun Oct 10, 2004 7:10 am

multiline is already enabled, what the problem is it wont scroll down, when the characters reach further than the user can see on the textbox, the textbox goes straight to the top when a message is sent or received
ssShotguNnn
 
Posts: 2
Joined: Thu Oct 07, 2004 10:56 am

Postby VBDude on Wed Oct 13, 2004 12:05 am

had the same issue...

in the properties of the textbox, enable vertical scrollbars.

That way, when you reach the limit of the visual text, the scroll bars will become active and allow you to scroll.

Hope this helps
VBDude
 
Posts: 0
Joined: Tue Oct 12, 2004 11:59 pm

Postby dragul on Thu Apr 21, 2005 2:07 pm

yea, they'll allow you to scroll but wont keep the focus on the bottom line, which i think ssShotguNnn is after. unfortuanatly i dont have the answer but im looking into it as i am now curious to the answer.
dragul
 
Posts: 16
Joined: Wed Apr 20, 2005 7:54 pm
Location: Abergavenny, Wales, UK

Postby Phate on Fri Apr 22, 2005 12:57 am

Welcome to DEVPPL VBDude and ssShotguNnn!

as to the second part of you post, i think that once the text hits a certian number of characters, you can print them to a txt file, but im not sure how!
Web-Developing since '03
Image
User avatar
Phate
500+ Club
 
Posts: 826
Joined: Sun Nov 21, 2004 4:12 am
Location: 127.0.0.1

Postby dafunkymunky on Mon Apr 25, 2005 7:17 am

hi shotgunn
instead of the txt box why dont you use rich text box it has much more options than text box and you can have part of the txt with bold diff font etc i think the solution for you prob lies in these 2 proiperties of rich text box

SelLength
The number of characters selected.

SelStart
An index, the starting point of text selected or the position of the insertion point of no text selected.

first find the length of the text in the text box using the fiorst property and then use the selstart and give the starting poiint as the length of the text
and then the cursor jumps to the final position

try this out if it doesnt work i'lll get you the code next time.

and one important thing
rich text box is a .ocx file or an activex control which comes free with vb
well you have to load it just like another activexcontrol

best of luck

--DAFUNKYMUNKY[/php]
User avatar
dafunkymunky
100+ Club
 
Posts: 183
Joined: Fri Apr 08, 2005 7:32 am
Location: India

Postby dafunkymunky on Mon Apr 25, 2005 7:24 am

for all the properties of the rich text box you can visit these sites

http://exchange.manifold.net/manifold/m ... xt_Box.htm

and dont forget to set focus after the final step i mentioned that
this is one exampole of how to use selstart etcetc

Private Sub Form_Load ()
Text1.Text = "Two of the peak human experiences"
Text1.Text = Text1.Text & " are good food and classical music."
End Sub
Private Sub Form_Click ()
Dim Search, Where ' Declare variables.
' Get search string from user.
Search = InputBox("Enter text to be found:")
Where = InStr(Text1.Text, Search) ' Find string in text.
If Where Then ' If found,
Text1.SetFocus
Text1.SelStart = Where - 1 ' set selection start and
Text1.SelLength = Len(Search) ' set selection length.
Else
MsgBox "String not found." ' Notify user.
End If
End Sub

found it in Microsoft website

--DAFUNKYMUNKY
User avatar
dafunkymunky
100+ Club
 
Posts: 183
Joined: Fri Apr 08, 2005 7:32 am
Location: India

Postby Fang Lunin on Fri May 13, 2005 9:59 am

I dont know about the rich text box, however i had this exact same problem before, we thought of a couple ways to fix it. one way that someone else tried (way too much work in my opinion) was to use a list box and a char cap on the message, however that is very messy in my opinion. Another option is to be lazy and insted of having each new message apear at the bottom, have it appear at the top and move everything else down, just save whats currently in the box to a string, then have the new version have the new message plus the rest (but only on the new screen, you dont send the entire chat box, just the message you send). While this does work just fine, it is a little anoying in my opinion.
Fang Lunin
 
Posts: 9
Joined: Fri May 13, 2005 8:49 am

Postby dafunkymunky on Fri May 13, 2005 1:49 pm

well ithink this is geettin a little too far i doubt if the ssshotgun is really gonna see this better stop it here or continue for the benifit of the devppl community
--------DAFUNKYMUNKY--------
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
User avatar
dafunkymunky
100+ Club
 
Posts: 183
Joined: Fri Apr 08, 2005 7:32 am
Location: India


Who is online

Users browsing this forum: No registered users and 3 guests