TextBox multiline=true and form AcceptButton

  • Thread starter Thread starter Michael
  • Start date Start date
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
 
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'.
 
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/>
 
Back
Top