DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2006
    Posts
    3

    Opening a new form from a TreeView

    I have a TreeView that I use to navigate to a new form. In an AfterSelect event method for the TreeView I use the following code to open the new form:

    XPMApp.Detail = new DetailForm(this);
    XPMApp.Detail.Show();
    XPMApp.Detail.Focus();

    The problem is that the new form opens and flashes in front on me, but focus goes back to/stays with the 1st form, and specifically the selected treeview.

    Any idea how to set the focus properly? Am I using the wrong event handler?

  2. #2
    Join Date
    Apr 2006
    Posts
    3
    Found the answer to this issue on MSDN forums:

    http://forums.microsoft.com/MSDN/Sho...20134&SiteID=1

    The key is to use the MouseMove event, since it fires last.
    Hope this helps anyone with a similar issue!

    Spencer

Similar Threads

  1. Opening a blank Infopath form from ASP.NET
    By vikramjparekh in forum ASP.NET
    Replies: 2
    Last Post: 07-24-2005, 10:21 PM
  2. opening a form by date
    By MacataQ in forum VB Classic
    Replies: 4
    Last Post: 07-05-2005, 12:00 PM
  3. Opening Form
    By Sayana Srinivasa Rao in forum .NET
    Replies: 6
    Last Post: 08-22-2002, 04:26 AM
  4. Replies: 0
    Last Post: 04-11-2002, 06:48 PM
  5. Replies: 0
    Last Post: 03-23-2002, 02:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links