Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <hr> <p>Assuming you are talking about WPF, then the positioning animation and easing functions would probably be best handled with xaml storyboard animation.</p> <p>The bigger question would be getting control of the applicaton or controls from another process. Assuming you have code for both applications it would be easier to implement some sort of interprocess communication and let the owning process reposition it's own elements. NamedPipeServerStream and NamedPipeClientStream would let you send/receive a reposition request.</p> <p>Otherwise, you might want to look into UI automation through AutomationPeers.</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms747327(v=VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms747327(v=VS.85).aspx</a></p> <hr> <p>Give the following xaml in an application:</p> <pre><code>&lt;Grid&gt; &lt;Button Name="btnOne" Content="this is test button"&gt; &lt;Button.Style&gt; &lt;Style TargetType="Button"&gt; &lt;Setter Property="Margin" Value="20" /&gt; &lt;Style.Triggers&gt; &lt;DataTrigger Binding="{Binding ElementName=PositionCheck,Path=IsChecked}" Value="True" &gt; &lt;Setter Property="Margin" Value="-150,20,150,20" /&gt; &lt;/DataTrigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/Button.Style&gt; &lt;/Button&gt; &lt;CheckBox Content="CheckBox" Name="PositionCheck" Visibility="Collapsed" AutomationProperties.AutomationId="chkToggle" VerticalAlignment="Top" /&gt; &lt;/Grid&gt; </code></pre> <p>You can make the button jump around from another application like this:</p> <pre><code> Process p = Process.GetProcessesByName("ProjectWithButton").FirstOrDefault(); if (p != null) { AutomationElement ele = AutomationElement.RootElement.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.ProcessIdProperty, p.Id)); if (ele != null) { AutomationElement chk= ele.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "chkToggle")); TogglePattern toggle = chk.GetCurrentPattern(TogglePattern.Pattern) as TogglePattern; System.Diagnostics.Debug.WriteLine(toggle.Current.ToggleState); toggle.Toggle(); } } </code></pre> <hr> <p>You could just as easily trigger animations, or have two text boxes with coordinates for movement.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload