CompuServe Thread

VB Question

2 messages in this thread
#1171From: Jim DalinOct 3, 1991 10:11 AM
I have what I can only assume is a dumb beginner's question about VB. In fact, it's a set of what I can only assume are interrelated questions. To be fair (to myself), I have, indeed, read the manual, but I just cant figure out what to do. What I'm trying to do is this: I have a form to be used to enter a name and address, up to 5 lines. So I created a five-line control array with five identical text boxes. So far, so good. You can enter text on all five lines, but have to press TAB to get from the end of one line to the start of the next, since the Enter key is not recognized (it just generates a beep). So I seem to need to write a "KeyPress" subroutine to look for the Enter key (ASCII 13) and then go to the start of the next line. Question: How do I get to the beginning of the next line? To phrase the same question a different way: how do I "internally generate" a Tab character? Related Question: more generally, how do I cause the cursor to go to some arbitrary spot of my choosing? Another related example: the user enters all five lines, then realizes they wish to wipe out line 3. So I wrote a (simple) routine to clear line 3 (obviously, by setting its .text characteristic = ""). But now I want to put the cursor back to the beginning of the line so the user can retype the line. How do I do that? Thanks in advance for your help. Jim Dalin
#1492From: John TrustmanOct 5, 1991 9:40 AM
Jim, The best way to do what you are asking is to buy the parts MS left out from Mark Novisoff here. He wrote and sells (when he's not telling how to get it for free<g>) and supports something called VBTOOLS which will do most of what you want for you. The easiest way to DIY is to use the control.SetFocus method to move the cursor for you. I can send you some examples if you need help. – JwT