TextBox multiline=true and form AcceptButton

M

Michael

Hi,

I have a form with a TextBox with its multiline property set to true. I also
have the form's AcceptButton set to a "Save" button.

With the setup above, the user cannot have the cursor in the multiline
textbox and press "Enter" key to change line, because when pressing "Enter"
key, the "Save" button is automatically clicked.

Is there a workaround? Or maybe what I am trying to do does not make sense?

Thanks,
Michael
 
H

Herfried K. Wagner [MVP]

Michael said:
I have a form with a TextBox with its multiline property set to true. I
also have the form's AcceptButton set to a "Save" button.

With the setup above, the user cannot have the cursor in the multiline
textbox and press "Enter" key to change line, because when pressing
"Enter" key, the "Save" button is automatically clicked.

Set the textbox' 'AcceptsReturn' property to 'True'.
 
Joined
Feb 26, 2011
Messages
1
Reaction score
0
Can we change the Accept Button to be pressed upon pressing the F2 key instead of the ENTER key.


Perfect! Thanks.

"Herfried K. Wagner [MVP]" <[email protected]> wrote in message
news:[email protected]...
> "Michael" <[email protected]> schrieb:
>> I have a form with a TextBox with its multiline property set to true. I
>> also have the form's AcceptButton set to a "Save" button.
>>
>> With the setup above, the user cannot have the cursor in the multiline
>> textbox and press "Enter" key to change line, because when pressing
>> "Enter" key, the "Save" button is automatically clicked.
>
> Set the textbox' 'AcceptsReturn' property to 'True'.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top