Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Box

Status
Not open for further replies.

EscapeUK

Programmer
Jul 7, 2000
438
0
0
GB
I have a text box how ever i want to insert a line of my own text and move the cursor down 2 lines so the user will not type over my text

thanks [sig][/sig]
 
Try:
[tt]
Text1.SetFocus
SendKeys "{DOWN 2}"
[/tt]

[sig]<p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>"For most users of personal computers, the single-user, single task restrictions are of no consequence. Personal computers work just fine with one console."<br>
<b><u>CP/M and the Personal Computer</u></b>[/sig]
 
Hi, i think you cannot probably restrict the user to type and as well not allow him to erase what you have already in it. on the other hand what you can do is in the validate event you can just append your line of text after the user has entered his text. You can do this one like this ;

Assuming your text is in some string variable and the multiline property for the text box has to be true in the scenario...

In text1_validate event :

text1.text = stryourstring & text1.text

Hope this would help you. If it isnt sorry for wasting your time i have no other idea...all the best...vijay [sig][/sig]
 
Okay, how about this... try as they might, the users will not be able to delete or change your message (only add to the contents of the text box):
[tt]
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
Mess$ = &quot;This is my message!&quot;
Temp$ = Text1.Text
If Len(Temp$) < Len(Mess$) Then
Text1.Text = Mess$
Exit Sub
End If
For R = 1 To Len(Mess$)
If Mid$(Temp$, R, 1) <> Mid$(Mess$, R, 1) Then
typo = True
Mid$(Temp$, R, 1) = Mid$(Mess$, R, 1)
End If
Next
If typo = True Then Text1.Text = Temp$
End Sub
[/tt]
[sig]<p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>"For most users of personal computers, the single-user, single task restrictions are of no consequence. Personal computers work just fine with one console."<br>
<b><u>CP/M and the Personal Computer</u></b>[/sig]
 
how do i bring the cursor down a couple of lines

Sendkeys &quot;{down2}&quot; does not seem to work [sig][/sig]
 
sorry ignore above message, i was not clear in what i needed to be done.

the user can type some text in the box it can be saved and the viewed again, the user can then make additions to the text.

But to make the lay out look neater i want to seperate the old text from any new text with a line. Like this

This is entry one

______________________________

this has been added later

______________________________

this has been added even later still
[sig][/sig]
 
sounds like a listbox where you are adding items [sig]<p>John Durbin<br><a href=mailto: john@johndurbin.com> john@johndurbin.com</a><br><a href= </a><br>MCP Visual FoxPro<br>
ICQ VFP ActiveList #73897253[/sig]
 
text1= yourString & vbkeyreturn & vbkeyReturn

tryp(myFace) [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top