Oh. I think I get what you want.
You want to have text that is entered make the parenthesis character move. Let's try using a textbox.
Make a Textbox with right justification
With each KeyPress event for the TextBoxCode:Text1.Alignment=vbRightJustify Text1.Text= "( )" '- 3 characters to start with start with: ' [open paren] space [close paren] Text1.SelStart = 2 ' makes the space the selected starting point Text1.SelLength = 1 ' one character only
You have to update the text, reset the Text1.SelStart, Text1.SelLength properties.
This is only a start - I don't have VB on this machine, I can't really do much more without experimenting. There are lots of people who post here that can take this a little further.
There are problems. The user could backspace (delete) a parenthesis character, could cut from the box, or paste into the box, for instance. You have to handle all of these issues.




Reply With Quote