Solved

I know this is a simple text box question

Posted on 1998-10-28
5
149 Views
Last Modified: 2010-04-30
Hi there!  You guys are the best.

I have a text box and I want it treated like a list box in regards to a list box .addItem.  If a global variable differs from what it originally was then it will be added to a new line in the text box.

I have the textbox multiline set to true and a timer interval set to 1

I've tried chr(10) & chr(13) and all I get are black boxes at the end of the new data so in the timer dialogue it looks something like this

text1.text = "This is a new variable = " & newVar & chr$(10) & chr$(13)

but this doesnt create a new line.

I know this has got to be a real simple question to answer I'm just over looking the obvious.
0
Comment
Question by:groone
5 Comments
 
LVL 3

Author Comment

by:groone
ID: 1442057
oh, this is VB5
0
 
LVL 2

Expert Comment

by:dabellei
ID: 1442058
You got it but you inverse it

& newvar & chr(13) & chr(10)

carriage return and line feed
0
 
LVL 3

Author Comment

by:groone
ID: 1442059
Ive tried that.  Okay, I've worked up a simple program involving a text box,  and cursor postion and basically want I want to happen is the new cursor position be placed on a new line in the text box.  I have multiline set to TRUE in the textbox

=======================
Private Type POINTAPI
    Y As Long
    X As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Private Sub Command1_Click()
Timer1.Interval = 5
End Sub

Private Sub Command2_Click()
Timer1.Interval = 0
End Sub

Private Sub Timer1_Timer()
Dim mousePT As POINTAPI
Dim X As Long
Dim Y As Long
   
    Call GetCursorPos(mousePT)
    X = mousePT.X
    Y = mousePT.Y
    Text1.Text = "Cursor Position - " & Y & "," & X & Chr(13) & Chr(10)
End Sub
0
 
LVL 18

Accepted Solution

by:
deighton earned 50 total points
ID: 1442060
How about using this key word

    Text1 = Text1 & vbCrLf & "hello Fred"
0
 
LVL 3

Expert Comment

by:fguerreiro_inix
ID: 1442061
Why don't you try
text1.text = text1.text & "This is a new variable = " & chr$(10) & chr$(13) & newVar

Instead of what you are using
text1.text = "This is a new variable = " & newVar & chr$(10) & chr$(13)

Hope this helps
Regards

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now