Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2005

Tip: Looking for answers? Try searching our database.

Focus issue with modeless form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael Wong - 13 Jan 2005 21:27 GMT
Hi,

Normally, when I close a MessageBox (called from the menu About), on the
main form that has a textbox that is previously focused and has some
text selected, the focus comes back to that textbox (same selected text).

But if the form, is a popup (modeless), showed from the main form, the
focus doesn't come back correctly to the textbox. I have to activate
other window, and come back to that popup form, to see the selected text
again.

Hope that my explaination is clear.

Anyone has a solution for this?

I am using Windows XP with .NET 1.1

Thanks
Michael Wong - 14 Jan 2005 01:00 GMT
Apparently, the focus went back to the popup form which doesn't give
back the focus to the last focused control.

What to do?

> Hi,
>
[quoted text clipped - 14 lines]
>
> Thanks
Michael Wong - 14 Jan 2005 01:42 GMT
For those interested, this is a work around:

Control ctrl = ActiveControl;
... MessageBox.Show(...)
ctrl.Focus();

> Hi,
>
[quoted text clipped - 14 lines]
>
> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.