 |
|
 |
Good Tutorial for beginners
|
|
|
|
 |
|
 |
Nice barcode tutorial post.
Steve@crystal Report
http://www.keepautomation.com/products/net_barcode_crystal_reports/barcodes/upca.html
|
|
|
|
 |
|
 |
A friend of mine introduce a new tech to me, it's include C#\.Net\Barcode Generator and some other things i don't know. he said it's very useful. i read that, but i still confused, after read your post. i think i know better. thanks!
|
|
|
|
 |
|
|
 |
|
 |
hi friend,
i am developing an application in c#.
I need your help friend, as i am new to c#,
my problem is "when i click a button in winform,the wpf should appear in the screen".
How to write a code for this help me.
Thank You,
Rgds,
shamil
|
|
|
|
 |
|
 |
See this[^] article.
/ravi
|
|
|
|
 |
|
|
 |
|
 |
Complex topic simply explained. Thanks.
|
|
|
|
 |
|
 |
Try this one...... a little bit i have modified...........
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace WpfApplication1 { /// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window { public Window1() { InitializeComponent(); } private void Window_Loaded(object sender, RoutedEventArgs e) { DoubleAnimation da = new DoubleAnimation(360, 0, new Duration(TimeSpan.FromSeconds(.1))); da.RepeatBehavior = RepeatBehavior.Forever; RotateTransform rt = new RotateTransform(); image1.RenderTransform = rt; image1.RenderTransformOrigin = new Point(0.5, 0.5); rt.BeginAnimation(RotateTransform.AngleProperty, da); this.button1_Click(); this.button2_Click(); this.button3_Click(); this.button4_Click(); this.button5_Click(); this.button6_Click(); this.button7_Click(); this.button8_Click(); this.button9_Click(); this.button10_Click(); this.button11_Click(); this.button12_Click(); } private void load() { DoubleAnimation da = new DoubleAnimation(360, 0, new Duration(TimeSpan.FromSeconds(2))); RotateTransform rt = new RotateTransform(); image1.RenderTransform = rt; image1.RenderTransformOrigin = new Point(0.5, 0.5); da.RepeatBehavior = RepeatBehavior.Forever; rt.BeginAnimation(RotateTransform.AngleProperty, da); } private void button1_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(1.1)); V.BeginAnimation(Button.WidthProperty, da); V.BeginAnimation(Border.HeightProperty, da); } private void button2_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(1.2)); I.BeginAnimation(Button.WidthProperty, da); I.BeginAnimation(Border.HeightProperty, da); } private void button3_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(1.3)); B.BeginAnimation(Button.WidthProperty, da); B.BeginAnimation(Border.HeightProperty, da); } private void button4_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(1.4)); G.BeginAnimation(Button.WidthProperty, da); G.BeginAnimation(Border.HeightProperty, da); } private void button5_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(1.5)); Y.BeginAnimation(Button.WidthProperty, da); Y.BeginAnimation(Border.HeightProperty, da); } private void button6_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(1.6)); O.BeginAnimation(Button.WidthProperty, da); O.BeginAnimation(Border.HeightProperty, da); } private void button7_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(1.7)); R.BeginAnimation(Button.WidthProperty, da); R.BeginAnimation(Border.HeightProperty, da); } private void button8_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(1.8)); B1.BeginAnimation(Button.WidthProperty, da); B1.BeginAnimation(Border.HeightProperty, da); } private void button9_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(1.9)); G1.BeginAnimation(Button.WidthProperty, da); G1.BeginAnimation(Border.HeightProperty, da); } private void button10_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(2)); Y1.BeginAnimation(Button.WidthProperty, da); Y1.BeginAnimation(Border.HeightProperty, da); } private void button11_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(2.1)); O1.BeginAnimation(Button.WidthProperty, da); O1.BeginAnimation(Border.HeightProperty, da); } private void button12_Click() { DoubleAnimation da = new DoubleAnimation(); da.From = 00; da.To = 400; da.RepeatBehavior = RepeatBehavior.Forever; da.Duration = new Duration(TimeSpan.FromSeconds(2.2)); R1.BeginAnimation(Button.WidthProperty, da); R1.BeginAnimation(Border.HeightProperty, da); } } }
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Loaded="Window_Loaded"> <Grid> <Image Margin="41,30,38,35" Name="image1" Stretch="None" Source="wheel.png" IsEnabled="True" StretchDirection="Both" /> <Border BorderBrush="Violet" Name="V" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10" > <TextBlock FontSize="50" Foreground="Violet">H</TextBlock></Border> <Border BorderBrush="Indigo" Name="I" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10" > <TextBlock FontSize="50" Foreground="Indigo">A</TextBlock> </Border> <Border BorderBrush="Blue" Name="B" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Blue">P </TextBlock> </Border> <Border BorderBrush="Green" Name="G" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Green">P </TextBlock> </Border> <Border BorderBrush="Yellow" Name="Y" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Yellow">Y </TextBlock> </Border> <Border BorderBrush="Orange" Name="O" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Orange">N </TextBlock> </Border> <Border BorderBrush="Red" Name="R" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Red">E </TextBlock> </Border> <Border BorderBrush="Blue" Name="B1" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Blue">W </TextBlock> </Border> <Border BorderBrush="Green" Name="G1" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Green">Y </TextBlock> </Border> <Border BorderBrush="Yellow" Name="Y1" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Yellow">E </TextBlock> </Border> <Border BorderBrush="Orange" Name="O1" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Orange">A </TextBlock> </Border> <Border BorderBrush="Red" Name="R1" BorderThickness="2" CornerRadius="1000" Margin="10,10,10,10"> <TextBlock FontSize="50" Foreground="Red">R </TextBlock> </Border> </Grid> </Window>
-- Modified Saturday, January 1, 2011 9:30 AM
|
|
|
|
 |
|
 |
This is my first attempt in getting a WPF app to do something. Thank for giving me the easy kick start!
|
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Hi Praveen,
I have to change IsItemHost property of grid to false to make wheelanimation work.
Can you explain me why?(in your source code its true!)
|
|
|
|
 |
|
 |
I found the discussion in WPF how and why helpful and it deals with Animation and graphics in general at the end.
|
|
|
|
 |
|
 |
There is a small typo where you in the following line,
da.RepeatBehavior = RepeatBehavior.Forever
should be
da.RepeatBehavior = RepeatBehavior.Forever;
Also this article indicates that setting the behavior of 'da' should occur after the BeginAnmiation command. I have had issues with this working properly once the BeginAnimation method is invoked you can't set properties of 'da' and have them applied to the current animation.
The solution to this is setting all properties of 'da' before you invoke BeginAnimation.
Please respond if I am incorrect, Otherwise so far its a great article!
|
|
|
|
 |
|
 |
Perfect, nice and simple demonstration for the beginner. Really good understanding of what's so impressive about WPF for the newcomer. Thanks so much!
|
|
|
|
 |
|
 |
Thank you
PraVeeN
blog.ninethsense.com/
|
|
|
|
 |
|
 |
NinethSense ... Thanks for sharing this beginner's article with community!
To improve further, explain your code little bit as why did you use DoubleAnimation etc.
Its fine to see some code doing something but it is great to understand why and how.
|
|
|
|
 |
|
 |
I will try explaining... soon
PraVeeN
blog.ninethsense.com/
|
|
|
|
 |
|
 |
Hi NinethSense,
I would like to thank you for these nice tutorials. I have tried to download the code with the Wheel and it worked.
Now i was trying to do the rectangle example. It compiles correctly but No action is associated with the clik on the button.
I will join you my code so that you have a look at my code.
C# code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Media.Animation;
namespace example2
{
///
/// Interaction logic for Window1.xaml
///
public partial class Window1 : System.Windows.Window
{
public Window1()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
DoubleAnimation da = new DoubleAnimation();
da.From = 0;
da.To = 360;
da.Duration = new Duration(TimeSpan.FromSeconds(3));
da.RepeatBehavior = RepeatBehavior.Forever;
RotateTransform rt = new RotateTransform();
rectangle1.RenderTransform = rt;
rt.BeginAnimation(RotateTransform.AngleProperty, da);
}
}
}
XAML code:
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="example2" Height="300" Width="300"
>
<button margin="140,111,77,133" name="button1">Button</button>
rectangle height="12" fill="Blue" margin="73,0,70,79.5" verticalalignment="Bottom" name="rectangle1"
I cannot right the Xaml code correctly , a bug in the post i think.
But i have put < /> for the rectangle and i've closed grid and Window at the end
I am using Visual Studio 2005, .Net Framework 3.0
Your Help is apreciated,
Ismail
modified on Friday, June 6, 2008 3:23 AM
|
|
|
|
 |
|
 |
Sorry, I missed this post. Problem solved?
PraVeeN
blog.ninethsense.com/
|
|
|
|
 |
|
 |
Window1.xaml
Source contains absolute path:
Source="file:///C:/Documents and Settings/Praveen/Desktop/WpfApplication1/bin/Release/wheel.png
I think it's better to change to relative I was surprised first to see the empty window.
|
|
|
|
 |
|
 |
Yes.
Thanks
PraVeeN
blog.ninethsense.com/
|
|
|
|
 |
|
 |
You yourself is telling dat you are abnormal .So i am excusing you for writing this article...
|
|
|
|
 |
|
 |
But dude, I am curious to know the reason for your comment. If what I wrote is wrong, I have to remove this article. Thanks for the feedback.
PraVeeN
blog.ninethsense.com/
|
|
|
|
 |