Small programs in the WPF area and small programs in the wpf Area
I have been working in Shenzhen for a month. I used to work in WinForm, but now I am working in WPF. I work overtime every day until AM, tired of me. There is also a process to learn new technologies, from the basic syntax and
Interface layout. This is a small piece of software I build.
Appreciation
On the basis of the original, a leaf fluttering effect is added.
The main code is as follows:
1 <Canvas. triggers> 2 <EventTrigger RoutedEvent = "FrameworkElement. loaded "> 3 <BeginStoryboard> 4 <Storyboard. targetName = "img1" Storyboard. targetProperty = "(Canvas. left) "> 5 <DoubleAnimation From =" 0 "To =" 514 "Duration =" 23:59:59 "RepeatBehavior =" "AutoReverse =" True "/> 6 </Storyboard> 7 </ beginStoryboard> 8 <BeginStoryboard Storyboard = "{StaticResource StoryboardLeaf}"/> 9 </EventTrigger> 10 </Canvas. triggers>Baiyun mobile
Leaf float KeyTime = "0" Value = "0" start position KeyTime = "0: 0" Value = "20" rotation time and angle (clockwise) keyTime = "" Value = "0" Last
Status
1 <Storyboard x: Key = "StoryboardLeaf" RepeatBehavior = "Forever"> 2 <DoubleAnimationUsingKeyFrames Storyboard. targetProperty = "(UIElement. renderTransform ). (TransformGroup. children) 3 4 [1]. (RotateTransform. angle) "Storyboard. targetName = "bd"> 5 <EasingDoubleKeyFrame KeyTime = "0" Value = "0"/> 6 <EasingDoubleKeyFrame KeyTime = "0: 0: 2" Value = "20"/> 7 <EasingDoubleKeyFrame KeyTime = "0: 4" Value = "0"/> 8 </DoubleAnimationUsingKeyFrames> 9 </Storyboard>Leaf float 1 this. ShowInTaskbar = false; // whether it is displayed on the taskbarWhether to display 1 timer = new DispatcherTimer () in the taskbar; // Class 2 timer processed by time interval. interval = TimeSpan. parse ("00:00:01"); // time interval of the time scale. The default value is timer. isEnabled = true; 4 timer. tick + = new EventHandler (timer_Tick); // DispatcherTimer. occurs when the Tick time interval is exceeded.Set the interval 1 BitmapImage dayOrNight = new BitmapImage (); // create an image 2 dayOrNight. beginInit (); 3 string uri = "pack: // application:,/WpfTimeZoneExample; component/Images/"; 4 int nowHour = Int32.Parse (DateTime. now. toString ("HH"); 5 if (nowHour> = 6 & nowHour <= 18) 6 {7 uri ++ = "sun2.png"; 8 DayMark. width = 105; 9 DayMark. height = 53; 10} 11 else12 {13 uri + = "moon.png"; 14 DayMark. width = 50; 15 DayMark. height = 50; 16} 17 dayOrNight. uriSource = new Uri (uri); // set source 18 dayOrNight. endInit (); 19 DayMark. source = dayOrNight;Code to create an image 1 private void timer_Tick (object sender, EventArgs e) 2 {3 CNT. text = DateTime. now. toString ("HH: mm: ss"); 4 UST. text = DateTime. now. addHours (-12 ). toString ("HH: mm: ss"); 5 UKT. text = DateTime. now. addHours (-7 ). toString ("HH: mm: ss"); 6 PRT. text = DateTime. now. addHours (-6 ). toString ("HH: mm: ss"); 7 SNT. text = DateTime. now. addHours (2 ). toString ("HH: mm: ss"); 8 BXT. text = DateTime. now. addHours (-11 ). toString ("HH: mm: ss"); 9}Run 1 private void Grid_PreviewMouseLeftButtonDown (object sender, MouseButtonEventArgs e) 2 {3 this. DragMove (); // drag 4}Program drag
When the mouse is placed, the sun/moon changes
1 private void DayMark_MouseEnter (object sender, MouseEventArgs e) 2 {3 TranslateTransform trans = new TranslateTransform (); // TransformGroup4 DayMark. renderTransform = trans; // set the translation object to 5 DoubleAnimation animation = new DoubleAnimation (15, TimeSpan. fromSeconds (1); // 15 is the target value, and the last parameter is animation duration 6 animation. autoReverse = true; // whether to play 7 trans in reverse order. beginAnimation (TranslateTransform. YProperty, animation); // TranslateT Ransform. YProperty: The property that moves along X and Y. BeginAnimation application animation 8}Mouse events
Finally, the development environment of this program: VS2013 running environment:. Net4.5 source code download: browsing the applet at the time of the partition
What is the good graph library for C ++ linguistics? Api, mfc, qt, wpf, and so on. Now I want to do some small programs to directly call the api?
According to the current popularity, C ++ can choose Qt if it is just a small program. Both API and MFC are partial to the underlying layer. WPF is Based on. Net.
Urgent visualstadio 2010 wpf, using C # To develop a small program, background music Problems
Put the startup of this background music in the Application.
How to use the Application in WPF? Check it for yourself...
Many operations can be performed in the Application.
Start playing (hide) in Application Start and Stop (destroy) in Application End )...
In addition, this resource is also obtained in other forms, and it can be operated in other forms...