Nov 21, 2009
Pages: 1, 2

Visual Basic 6.0 Help Needed - Adding lines to a textbox without delete

free web hosting

Read Latest Entries..: (Post #19) by iGuest on Nov 9 2009, 10:02 AM.
You roxx baby........... Visual Basic 6.0 Help Needed Replying to EikonI just wanna say, that because of you I have got 48/50 marks in vb... I just wanna thank you a lot... I bless God that u get everything you want in lyf... THAAAAANXXXX -feedback by Swapnil Godse  
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > MODERATED AREA > Computers > Programming Languages > VB Programming

Visual Basic 6.0 Help Needed - Adding lines to a textbox without delete

rejected
I need help with Visual Basic 6.0 and adding lines to a textbox without deleting any previous lines.. I've gotten as far as finding a way to add the lines, but it deletes the prevous entree.

Help is appreciated!

Comment/Reply (w/o sign-up)

Eikon
Don't really understand what you are trying to do... Do you mean having a textbox that says:
"Hello My Name Is "
and then adding
"Rejected" to it?
Or do you mean
Rejected
Then adding "Hello My Name is.." above that?

Either way try just doing...
CODE

txtBox.text="Hello my name is..."
txtBox.text=txtBox.text & "Rejected"

OR
[code]
txtBox.text="Rejected"
txtBox.text="Hello my name is" & txtBox.text
Feel free to pm me if I didnt understand...Also sorry i havnt used VB in a while, I may be wrong

Comment/Reply (w/o sign-up)

Galahad
Hi

That code works,but it doesn't add new lines,it just appends text at the end of existing one.To add a new line,you would type something like this.

CODE

Text1.Text = "This is line one in the textbox"
Text1.Text = Text1.Text & vbCrLf & "This is line two in the textbox"


It is neccesary to use vbCrLf (Chr$(13) & Chr$(10)) because using only vbCr(Chr$(13)) or vbLf(Chr$(10)) will display single caracter,and won't insert new line.Hop this helped a bit.

Cheers

Comment/Reply (w/o sign-up)

FeedBacker
Appends%20vs%20add%20item
Visual Basic 6.0 Help Needed

Well, I'm trying to load many random numbers one under another in a textbox, but when those items are about 30000 this process gets really slow. I'm using the same code:

Textbox = textbox & line & vbCrLf

But when the textbox is really big, then it became slow and slow. Is there any other way to add text at the end of the textbox multiline? Thanks.

-hotpadrino

Comment/Reply (w/o sign-up)

Galahad
QUOTE(FeedBacker @ Dec 21 2007, 08:46 PM) *
Appends%20vs%20add%20item

Visual Basic 6.0 Help Needed
Well, I'm trying to load many random numbers one under another in a textbox, but when those items are about 30000 this process gets really slow. I'm using the same code:

Textbox = textbox & line & vbCrLf

But when the textbox is really big, then it became slow and slow. Is there any other way to add text at the end of the textbox multiline? Thanks.

-hotpadrino


I can see that i can be slow, it's a lot of information... Do you need a user to see these numbers as they appear? If not, you can just fill the numbers to a variable, and then just display that variables' contents...

What makes this process slow, is that VB engine, refreshes the data every time you update your text box information... So, every time you add a new line, VB refreshes the entire Text property...

One way to solve this would be:
CODE
Dim i As Long
Dim s As String

For i = 1 to 50000
  s= s & Trim(Cstr(i)) & vbCrLf
Next i
Text1.Text = s


This will add 50000 lines to variable s, and then assign s to text box Text1... Doing it this way, is much quicked, because VB doesnt have to refresh the text box 50000 times, only once...

Hope this helped...

 

 

 


Comment/Reply (w/o sign-up)

FeedBacker
adding text in VB
Visual Basic 6.0 Help Needed

I am trying to create my own little word processor. My first goal is to add a character every time you press a button. I seem unable to add characters to the text box. My button click just replaces the text in the box with a single letter over and over. I just don't seem to know the code or property to do this. Help!

Text1.Text = "a"

(the code to have an "a" show up...My goal is to hit a button and have the same number of "a's" (in this case) show up. How to do?

Comment/Reply (w/o sign-up)

FeedBacker
speed of vb6
Visual Basic 6.0 Help Needed

Replying to Galahad

I'm curious about the speed of vb6. Applications I have written are very slow, when it comes to calculating numbers, etc. Coordinates, prime numbers and so on. I made some kind of brute force prime number calculator and it is extremely slow. Similar kind of setup made with see++ works way much faster, so is there something wrong in vb6 or in my code?

Comment/Reply (w/o sign-up)

Galahad
QUOTE(FeedBacker @ Jan 20 2008, 07:22 AM) *
speed of vb6

Visual Basic 6.0 Help Needed
<a href=http://www.trap17.com/forums/index.php?showtopic=30880&view=findpost&p=366104>Replying to Galahad</a>

I'm curious about the speed of vb6. Applications I have written are very slow, when it comes to calculating numbers, etc. Coordinates, prime numbers and so on. I made some kind of brute force prime number calculator and it is extremely slow. Similar kind of setup made with see++ works way much faster, so is there something wrong in vb6 or in my code?


Well, VB by design is kind of slow for some operations... I see that it would be slow on prime number calculations... Visual Basic is interpreted not compiled code, and from that comes its slowness... What youc oudl do, is create a project, and under Project options window, use optimisations like, "Optimize for fast code", enable "Favour pentium pro", and alike...

Also, try how different variable types affect the speed, integer, long, single, double...

Also, compiled code will run much faster than from IDE, always remember that...

Comment/Reply (w/o sign-up)

FeedBacker
Greetings!, how can I make a textbox1.Text adding to textbox2.Text and the result goes to textbox2? pls. Help me.Ty.

Comment/Reply (w/o sign-up)

FeedBacker
Greeting!, how can I add textbox1 to texbox2 and the result goes to textbox3?
pls. Help me. Ty.

Comment/Reply (w/o sign-up)

Latest Entries

iGuest
You roxx baby...........
Visual Basic 6.0 Help Needed

Replying to EikonI just wanna say, that because of you I have got 48/50 marks in vb... I just wanna thank you a lot... I bless God that u get everything you want in lyf... THAAAAANXXXX

-feedback by Swapnil Godse

 


Comment/Reply (w/o sign-up)

iGuest
Re: VB6 Text Book Control
Visual Basic 6.0 Help Needed

Hello, Jayanta Bardalai.

See: RTF (Rich Text Formatting) Text Box Controls (RICHTX32.OCX) to achieve this.

For instance, a function I made for RTF boxes that works for inputting different colours:

 


Public Function OutputToScreen(ByRef strOutput As String, Optional ByRef lngColour As Long = &HC0C0C0, Optional ByRef bytAmountEnters As Byte = 0)
With frmMain.RtbScreen
 .SelStart = Len(.Text)
 .SelColor = lngColour
 .SelText = String(bytAmountEnters, Asc(vbCrLf)) & strOutput
End With
End Function

 


You may have to alter the code slightly to adjust to your desires.

-Donkano

-reply by Donkano

Comment/Reply (w/o sign-up)

contactskn


My dear friend it is very easy to add text lines to a text box keeping the existing line intact. 
For example:
You have two variables a and b
and a text box named text1

a = “Visual Basic ”
b = “ Is a programming language”

If we code as 
text1.text = a
---
then text1 which show Visual Basic, if we want to add the second line that is the value of variable b to the current text then the following code is applicable

text1.text = text1.text & b

or 

text1.text = a & b

both the coding gives the same results that is 

Visual Basic Is a programming language






Comment/Reply (w/o sign-up)

iGuest
Text box filter
Visual Basic 6.0 Help Needed

Text1.Text = wate 100.00 g
I need
Text2.Text = 100.00


-reply by shahid

Comment/Reply (w/o sign-up)

Galahad
QUOTE(iGuest-Jayanta Bardalai @ Jul 2 2008, 07:24 AM) *
VB6 Text Book Control

Visual Basic 6.0 Help Needed
I have a text box and it's Multiple line option is enabled.
The Text books contains the following text
"This is normal"
"This is Bold"
"This is Italic"
I would be grateful if you kindly let me reply to get the desired results as mentioned.

Thanks
C

-question by Jayanta Bardalai


With standard TextBox you can't have multiple fnt styles... If you want that, then use RichTextBox control, that allows multuple font styles, colors and others...

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
Similar Topics

Keywords : visual, basic, 6, 0, needed, adding, lines, textbox, delete

  1. Arrays And List Boxes
    VB6 Codes needed (2)
  2. Ftp In Vb 2005
    badly needed! (0)
    Hello, i was wondering real badly. Does anybody know how to make an FTP browser or uploader in
    Visual Basic 2005 (also in 2008 - but they are the same) because i am making an add-on for my
    webbrowser. Or atleast can they send me a link. But please do not send me a link and tell me to
    search it - i've given up searching for 2005. Many many thanks if someone's found one for
    me. Rep++++....
  3. Mysql In Visual Basic
    Mysql in visual basic (8)
    I'm am trying to create a script so that visual basic 6 can interact with mysql Any ideas?....
  4. Beginning Visual Basic
    (4)
    CAn anyone give me a guide on VB? I've decided to learn it and I need something to work with....
    thanks ....
  5. My Guidewriter
    Simple Visual Basic program to aid in making guides (3)
    I wrote this about 3 months ago for a different forum (Runescape Forums, one I'm currently a
    G-Mod of. ) and I figured I'd share it with you. All it is, is a text editor with built in
    buttons and menus for adding BBCodes. For example, if you wanted to make something bold, you type
    what you want, highlight it, find bold in the text menu and click it. The nicest thing is, you
    can save, and you don't have to worry about a forum failing after taking hours to write a guide.
    I highly suggest you try it if you write guides often, the members on RsForums really lo....
  6. Some Visual Basic 6.0 Uncompleted Projects
    (2)
    hi friends, i have some good complete and incomplete projects in visual basic 6.0. and now i
    want to sale them for some credit points. 100 credit points only....
  7. Visual Basic And Internet Transmission
    is it possible to encrypt a http request? (2)
    I've used VB before which is why im asking this in the VB forum and not any other forum because
    i know with any other language other than PHP i have no chance so i dont actually know if this is
    possible with VB WHat i want to do is change a HTTP request that is sent to a server so that a web
    filter cannot understand it and block the request. Before anyone says that i shouldnt do that its
    hacking etc...its not...im only doing it to see if it can be done. if i wanted to get around a
    filter i wouldnt bother making my own tool I'd use someone else (skript kiddy-ish ....
  8. Visual Basic 6
    (5)
    Well currently I have the working model edition for Visual Basic 6.0 which won't allow me to
    make .exe files. I was looking into buying the Learning Edition but I can't find it cheap or in
    stock anywhere. I want to try and find it for under $100 used or new. If anyone has it, and would
    like to make the .exe file for me if I send you the files that would be great, or if anyone could
    help me find it for cheap.....
  9. Visual Basic Express Edition Beta
    How does it work? (2)
    Hey, I'm using (sorta) Visual Basic Express Edition Beta 2 (long name, eh?), but I can't
    find any good tutorials on it; all of them are for visual basic.net... Is this the same thing? I
    don't think so, and if I'm right, where can I go to get help for it?....
  10. Help Needed
    (7)
    Hello guys...I made a program but when i run it i get a debug because i put the wrong timers action
    i tried to change it but still: Private Sub Form_Load() Let lblTime.Caption = Let Timer1.Enabled =
    True Let Timer2.Enabled = False End Sub Can anybody tell me how to put the timers auction on the
    second line?....
  11. Free Copy Of Visual Studio.net Pro
    STUDENTS ONLY (11)
    Visit THE SPOKE for your free copy of Visual Studio.NET.....
  12. The Rtf Textbox Control, And Asian Characters
    If someone could shed some light... (5)
    I'm currently working on a project for school. I have to make a program for a client, and my
    client is the head of the Japanese Dept. I have run into a small problem however... After finally
    managing to work out a way to actually get VB to display Asian characters, using the .textRTF
    property of the richtextbox control. But, in doing this, it turns it into something like this...
    CODE {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\froman\fprq1\fcharset128 MS UI
    Gothic;}{\f1\fnil\fcharset0 MS Sans Serif;}}
    \viewkind4\uc1\pard\lang1041\f0\fs17\'93\'fa\'96....
  13. [tutorial] Visual Basic 6 Minimize To Tray
    Minimize to Tray (9)
    This example will "minimize" your program to the system tray when you click on a button, and restore
    it when you click the system tray icon. For this example you'll need: 1 Form - Form1 1 button -
    Command1 Add a Module to your project, and ad this code: CODE ' Create an Icon in System
    Tray Needs Public Type NOTIFYICONDATA cbSize As Long hwnd As Long uId As Long uFlags As Long
    uCallBackMessage As Long hIcon As Long szTip As String * 64 End Type Public Const NIM_ADD = &H0
    Public Const NIM_MODIFY = &H1 Public Const NIM_DELETE = &H2 Public Const WM_MOUSEMOVE ....
  14. [tutorial] Visual Basic 6 Removing List Duplicates
    Removing List Duplicates (3)
    Removing duplicates from lists is something that you'll have to put up with if you're, say,
    parsing names off Outwar. Many delete-duplicate for...next loops are very slow, especially when you
    have thousands of names to loop through several thousand times for each name on the list. This
    function that I made is, in my opinion, the best and quickest way to do it without too many annoying
    and slow for loops (good for lists 1k +). It compares lstA to lstB. Anything that is in both lists
    is added to lstC. To change it so that anything that isn't in both lists is ....
  15. [tutorial] Visual Basic 6 Downloading Images From A Webpage
    Downloading Images from a webpage (2)
    Here's how to grab an image off the internet easily. You'll need an Inet on your form to do
    this. You can always get rid of your string variables and substitute the actual strings: Code:
    CODE Dim localFile As String Dim remoteFile As String Dim fNum As Long Dim b() As Byte
    remoteFile = "http://www.site.com/image.jpg" localFile = "C:\image.jpg"       fNum = FreeFile b()
    = Inet1.OpenURL(remoteFile, icByteArray) Open localFile For Binary As #fNum Put #fNum, , b() Close
    #fNum MsgBox "Done" Hope this helps. added code bbcode ....

    1. Looking for visual, basic, 6, 0, needed, adding, lines, textbox, delete

Searching Video's for visual, basic, 6, 0, needed, adding, lines, textbox, delete
See Also,
advertisement


Visual Basic 6.0 Help Needed - Adding lines to a textbox without delete

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com