Weird textbox behaviour

ernestus
03-16-2003, 03:58 AM
I'm having a problem I have not seen before.

When creating a program, I often copy an existing project and convert that for the new job. Never had any problems doing this. In this case I am using a TEST project which I use to try out new ideas. Recently I have been playing with webbrowser/inet controls on this TEST project.

Copied TEST for a new job, completed the job, it's quite small and thought I did not have the right textbox settings when the three text boxes refused to accept typed carrets (carriagereturns/linefeeds).

However when I check scroll and multiline they are set okay.

Import or create a new textbox to the same form and the same happens - no carrets possible. However if I create a new form in the same project and copy over some of the offending textboxes, they will accept carrets.

This makes me think that there is something obstructing multi-line at the form level. Perhaps some of the controls I played with on the original TEST project have made changes to the form that are remaining there, even though on the new project I have nothing other than texboxes, labels, command buttons, and file/directory boxes.

Have done a line by line comparison of the form properties with one in another project that is working okay, and I can't see anything different! Any ideas?

Do note that this is more of an educational curiousity - I have a solution in that I can transfer all items to a new form!

Regards,

Ernest

Deadalus
03-16-2003, 02:50 PM
One thing I can think of is a command button with Default set to True. That would cause Enter in a textbox to do nothing.

ernestus
03-17-2003, 01:51 AM
Nicely spotted!

That is the culprit!

Much appreciated.

Regards,

Ernest

ernestus
03-17-2003, 02:02 AM
I'm sorry, I forgot a small clarification to the previous post.

Although the command button was set Default=True, the button was redundant and had had no actions associated with it.

Thus hitting Enter did nothing and the cursor remained in the Textbox.

Regards,

Ernest

Deadalus
03-17-2003, 06:27 AM
In fact the cursor would remain in the textbox anyway, unless the code in the button changes the focus. A good thing the button wasn't deleting files. :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum