Search
Thursday, November 20, 2008 ..:: Blendblog.net ::.. Register  Login
 Bloggers Minimize

 Print   
 Sponsors Minimize

 Print   
 Users Online Minimize
Membership Membership:
Latest New User Latest: areel
New Today New Today: 0
New Yesterday New Yesterday: 0
User Count Overall: 15

People Online People Online:
Visitors Visitors: 0
Members Members: 0
Total Total: 0

Online Now Online Now:

 Print   
 Welcome to blendblog.net! Minimize

If you are a developer or designer who is creating cutting edge user interface experiences using Microsoft Expression Blend you've just found a great resource!  The purpose of this site is to share our experience with this brand new product.  As with any new piece of software there is a ton to discover.  Bugs will be revealed and workarounds discovered, hopefully this can be a resource to share in the discovery process!

While this site will focus largely on Expression Blend, it will also encompass WPF, Visual Studio, Silverlight, and other .net 3.5 technologies as they relate to the creation of great software.

Please login using your Microsoft LiveID or register a new account.  Doing so will let you comment on any of the blog entries on the site.  We look forward to helping you in your endeavors as well as you helping others in theirs!  We'd love to have more bloggers on our site...if you are interested please register and contact us!


 Print   
 How to find the absolute position (point) of any control on your form Minimize
Location: BlogsSean Cullinan    
Posted by: Sean Cullinan 2/11/2008 10:25 PM

The hierarctical structure of WPF is great but can make things confusing when trying to determine the location of things.  I have a navigation control on my main form that would raise an event when an item was clicked.  My form recieves the event, on which I wanted to build a custom listbox that overlayed on my form displaying a list of things the user can select from.  In order to do this I wanted to know the location on the form in absolute terms of the control that raised the event.  In order to do this you must use a "GeneralTransform" object and the TransformToAncestor method on the control you wish to get the absolute position of.  Here is the code:

Dim gt As GeneralTransform = myUserControl.TransformToAncestor(Me)
Dim pt As Point = gt.Transform(New Point(0, 0))

That's it, you now have a point with the location of your control with which you can do whatever you'd like!

Permalink |  Trackback

Your name:
Title:
Comment:
Add Comment   Cancel 

  
 Search Minimize

 Print   
 Archive Minimize

 Print   
 Blendblog Survey Minimize
Our next client application will be written using:




Submit Survey  View Results

 Print   
Copyright 2008 by blendblog.net   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2008 by DotNetNuke Corporation