Google Groups Home
Help | Sign in
Bug w/ button having focus while in textbox
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
jgc  
View profile
 More options Jan 24 2004, 5:12 pm
Newsgroups: microsoft.public.dotnet.framework.windowsforms
From: jgc <jgc...@hotmail.com>
Date: Sat, 24 Jan 2004 14:11:04 -0800
Local: Sat, Jan 24 2004 5:11 pm
Subject: Bug w/ button having focus while in textbox
There seems to be a bug where if you're in a textbox, a button can still have focus and prevent you from using the "enter" key in the multi-line textbox.  This happens when you have a button and a textbox in a child form, go to another child and return back to the initial child.  Here's how to re-create the problem:

1. Create a child form with a button and a MULTILINE textbox.
2. In the MDI parent form, open two of those child forms (you could do it in the OnLoad event)
3. Run the program.  Two child forms should show.  Let's call the child that's on top "child 1" and the other "child 2"
4. "child 1" is currently on top.  Now, click on "child 2" and click back on "child 1".
5. Click on the textbox on "child 1" and hit return ("ENTER").  You will NOT be able to go down to the next line.

It seems that upon re-activating "child 1", the form gives the button the focus again, but does not "release" the focus even when you put the cursor in the textbox.

So, even though you click on the text box & put the cursor there, hitting ENTER still makes the form fire the Click event on the button.

I have not found anything like this in the KB.  If you have any workaround or know the solution please let us know.

Thanks!

jgc


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yuriy Solodkyy  
View profile
 More options Jan 25 2004, 4:41 pm
Newsgroups: microsoft.public.dotnet.framework.windowsforms
From: "Yuriy Solodkyy" <s...@softasap.com>
Date: Sun, 25 Jan 2004 23:38:06 +0200
Local: Sun, Jan 25 2004 4:38 pm
Subject: Re: Bug w/ button having focus while in textbox
I think this behaviour is by design.  For considers last activated buttont
as default form button.  According to "TextBox.AcceptsReturn Property" help
topic you must set this property to "true", to ensure RETURN key is always
handled by the textbox control.

--
Yuriy

"jgc" <jgc...@hotmail.com> wrote in message

news:FE7BF2CD-3296-453D-A743-D8B35077444C@microsoft.com...
> There seems to be a bug where if you're in a textbox, a button can still

have focus and prevent you from using the "enter" key in the multi-line
textbox.  This happens when you have a button and a textbox in a child form,
go to another child and return back to the initial child.  Here's how to
re-create the problem:

> 1. Create a child form with a button and a MULTILINE textbox.
> 2. In the MDI parent form, open two of those child forms (you could do it

in the OnLoad event)
> 3. Run the program.  Two child forms should show.  Let's call the child

that's on top "child 1" and the other "child 2"
> 4. "child 1" is currently on top.  Now, click on "child 2" and click back
on "child 1".
> 5. Click on the textbox on "child 1" and hit return ("ENTER").  You will

NOT be able to go down to the next line.

> It seems that upon re-activating "child 1", the form gives the button the

focus again, but does not "release" the focus even when you put the cursor
in the textbox.

> So, even though you click on the text box & put the cursor there, hitting

ENTER still makes the form fire the Click event on the button.

> I have not found anything like this in the KB.  If you have any workaround

or know the solution please let us know.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google