Opening a new form from a TreeView


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Opening a new form from a TreeView

  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, 11:21 PM
  2. opening a form by date
    By MacataQ in forum VB Classic
    Replies: 4
    Last Post: 07-05-2005, 01:00 PM
  3. Opening Form
    By Sayana Srinivasa Rao in forum .NET
    Replies: 6
    Last Post: 08-22-2002, 05:26 AM
  4. Replies: 0
    Last Post: 04-11-2002, 07:48 PM
  5. Replies: 0
    Last Post: 03-23-2002, 03:55 PM

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center