| You are here: DEVPPL ‹ Forum ‹ Programming ‹ Visual Basic Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
Text Box
10 posts
• Page 1 of 1
0
Text Box
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!
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
- Reputation: 0
- Posts: 2
- Joined: Thu Oct 07, 2004 11:56 am
- Highscores: 0
- Arcade winning challenges: 0
0
the solution is
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
- Reputation: 0
- Posts: 10
- Joined: Wed Oct 06, 2004 7:27 pm
- Location: toronto
- Highscores: 0
- Arcade winning challenges: 0
0
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
- Reputation: 0
- Posts: 2
- Joined: Thu Oct 07, 2004 11:56 am
- Highscores: 0
- Arcade winning challenges: 0
0
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
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
- Reputation: 0
- Posts: 1
- Joined: Wed Oct 13, 2004 12:59 am
- Highscores: 0
- Arcade winning challenges: 0
0
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
- Reputation: 0
- Posts: 16
- Joined: Wed Apr 20, 2005 8:54 pm
- Location: Abergavenny, Wales, UK
- Highscores: 0
- Arcade winning challenges: 0
0
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!
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!
- Phate
- Reputation: 0
- Posts: 826
- Joined: Sun Nov 21, 2004 5:12 am
- Location: 127.0.0.1
- Highscores: 0
- Arcade winning challenges: 0
0
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]
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]
- Dafunkymunky
- Reputation: 0
- Posts: 183
- Joined: Fri Apr 08, 2005 8:32 am
- Location: India
- Highscores: 0
- Arcade winning challenges: 0
0
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
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
- Dafunkymunky
- Reputation: 0
- Posts: 183
- Joined: Fri Apr 08, 2005 8:32 am
- Location: India
- Highscores: 0
- Arcade winning challenges: 0
0
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
- Reputation: 0
- Posts: 9
- Joined: Fri May 13, 2005 9:49 am
- Highscores: 0
- Arcade winning challenges: 0
0
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....
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
- Dafunkymunky
- Reputation: 0
- Posts: 183
- Joined: Fri Apr 08, 2005 8:32 am
- Location: India
- Highscores: 0
- Arcade winning challenges: 0
|
|
