Click here to Skip to main content
15,916,835 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: In-browser access to a fingerprint scanner Pin
Abhinav S8-Nov-10 1:19
Abhinav S8-Nov-10 1:19 
AnswerRe: In-browser access to a fingerprint scanner Pin
Pete O'Hanlon8-Nov-10 1:51
mvePete O'Hanlon8-Nov-10 1:51 
GeneralRe: In-browser access to a fingerprint scanner Pin
Ray Cassick8-Nov-10 7:22
Ray Cassick8-Nov-10 7:22 
GeneralRe: In-browser access to a fingerprint scanner Pin
Pete O'Hanlon8-Nov-10 9:11
mvePete O'Hanlon8-Nov-10 9:11 
GeneralRe: In-browser access to a fingerprint scanner Pin
Ray Cassick8-Nov-10 14:45
Ray Cassick8-Nov-10 14:45 
QuestionHow to get all names of columns of all tables from model, in silverlight Pin
jadughar6-Nov-10 7:53
jadughar6-Nov-10 7:53 
AnswerRe: How to get all names of columns of all tables from model, in silverlight Pin
Abhinav S6-Nov-10 8:10
Abhinav S6-Nov-10 8:10 
GeneralRe: How to get all names of columns of all tables from model, in silverlight Pin
jadughar6-Nov-10 8:26
jadughar6-Nov-10 8:26 
AnswerRe: How to get all names of columns of all tables from model, in silverlight Pin
Abhinav S6-Nov-10 16:57
Abhinav S6-Nov-10 16:57 
GeneralRe: How to get all names of columns of all tables from model, in silverlight Pin
jadughar7-Nov-10 9:13
jadughar7-Nov-10 9:13 
GeneralRe: How to get all names of columns of all tables from model, in silverlight Pin
jadughar7-Nov-10 22:11
jadughar7-Nov-10 22:11 
AnswerRe: How to get all names of columns of all tables from model, in silverlight Pin
Abhinav S8-Nov-10 1:13
Abhinav S8-Nov-10 1:13 
GeneralRe: How to get all names of columns of all tables from model, in silverlight Pin
jadughar8-Nov-10 3:01
jadughar8-Nov-10 3:01 
GeneralRe: How to get all names of columns of all tables from model, in silverlight Pin
Abhinav S8-Nov-10 5:12
Abhinav S8-Nov-10 5:12 
Questionhierarchical data grid in silverlight Pin
C-sharper 15-Nov-10 7:13
C-sharper 15-Nov-10 7:13 
AnswerRe: hierarchical data grid in silverlight Pin
Abhinav S5-Nov-10 19:03
Abhinav S5-Nov-10 19:03 
GeneralRe: hierarchical data grid in silverlight Pin
C-sharper 110-Nov-10 0:04
C-sharper 110-Nov-10 0:04 
AnswerRe: hierarchical data grid in silverlight Pin
RugbyLeague11-Nov-10 5:42
RugbyLeague11-Nov-10 5:42 
QuestionTreeview - XML - HierarchicalDataTemplate Pin
RugbyLeague5-Nov-10 6:20
RugbyLeague5-Nov-10 6:20 
AnswerRe: Treeview - XML - HierarchicalDataTemplate Pin
RugbyLeague7-Nov-10 22:13
RugbyLeague7-Nov-10 22:13 
GeneralRe: Treeview - XML - HierarchicalDataTemplate Pin
Kevin Marois11-Nov-10 5:38
professionalKevin Marois11-Nov-10 5:38 
GeneralRe: Treeview - XML - HierarchicalDataTemplate Pin
RugbyLeague11-Nov-10 5:39
RugbyLeague11-Nov-10 5:39 
QuestionEye that follow cursor of the mouse Pin
VisualLive4-Nov-10 23:59
VisualLive4-Nov-10 23:59 
Hi ,
i wish build a control(wpf) that the Eye(Ellipse) follow the cursor of the mouse.
here is a snippet code that i am developing :

XML
<Window Height="480" Title="Window2" Width="640" x:Class="WpfApplication5.Window2"
     x:Name="Window" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Window.Resources>
<Storyboard x:Key="OnLoaded1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ctrCircle" 
    Storyboard.TargetProperty="(UIElement.RenderTransform).( TransformGroup.Children)[3].(TranslateTransform.X)">
<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ctrCircle" 
            Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ExponentialEase EasingMode="EaseOut" />
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Style TargetType="Ellipse">
       <Setter Property="RenderTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="1" ScaleY="1"/>
           </Setter.Value>
        </Setter>
       <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
    </Style>
    </Window.Resources>
 <Canvas MouseMove="mov" x:Name="LayoutRoot">
    <Border ackground="Black" B="" Canvas.Left="178" Canvas.Top="103" 
        CornerRadius="250" Height="255.5" Width="290" x:Name="border_eye">
        <Ellipse Fill="#FFFFC600" Height="12" HorizontalAlignment="Left" 
            Margin="0" RenderTransformOrigin="0.5,0.5" Stroke="{x:Null}" 
            VerticalAlignment="Center" Visibility="Visible" Width="12" x:Name="ctrCircle">
            <Ellipse.RenderTransform>
                <TransformGroup>
                     <ScaleTransform />
                    <SkewTransform />
                    <RotateTransform />
                    <TranslateTransform />                 
                </TransformGroup>
            </Ellipse.RenderTransform>
        </Ellipse>
    </Border>
</Canvas>
</Window>



and in the code behind :
C#
private void mov(object sender, MouseEventArgs e)
        {
	 System.Windows.Point pt = e.GetPosition((Canvas)sender);
          Storyboard invokeStoryboard = this.Resources["OnLoaded1"] as Storyboard;
            ((DoubleAnimationUsingKeyFrames)invokeStoryboard.Children[0]).KeyFrames[0].Value = pt.X;
            ((DoubleAnimationUsingKeyFrames)invokeStoryboard.Children[1]).KeyFrames[0].Value = pt.Y;
            invokeStoryboard.Begin();
        }


now my purpose is when i move the mouse in the Canvas area(LayoutRoot) the Ellipse(ctrCircle) move only inside the Border(border_eye) and don't overcome the area of the "border_eye" this effect is similar an eye.

Do you have any idea how to perform this step?

Thanks so much for your attention Smile | :)

Have a nice day.
Question2 web sites 1 source of uploads Pin
Mycroft Holmes4-Nov-10 17:50
professionalMycroft Holmes4-Nov-10 17:50 
AnswerRe: 2 web sites 1 source of uploads Pin
AspDotNetDev4-Nov-10 18:05
protectorAspDotNetDev4-Nov-10 18:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.