Floating FB sharing byReview Results

Floating FB sharing byReview Results

  • WPF Tutorial

    • # Read in Your Language


    WPF Controls

    Tutorial Home | Layouts | Containers | Button | CheckBox and CheckedListBox | ComboBox | DateTimePicker and MonthCalendar | DataGrid | Label and LinkLabel | ListBox | ListView | TextBox and MaskedTextBox | PictureBox and ProgressBar | TreeView | WebBrowser | Menus,Status and Toolbar | RadioButton | RichTextBox | ToolTip and Scrolling | Custom Controls

    PictureBox and ProgressBar controls in WPF

    Image:


    Namespace : System.Windows.Controls.Image

    Designer Code:

    
            <StackPanel>
                <Image Name="img1" Source="Images\win2wpf.JPG" Height="30"/>
                <Image Name="img2" Source="Images\win2wpf.JPG" Height="30"/>
            </StackPanel>
            

    Code Behind:

    Setting Image from code:
    Need to use ImageSource to set the images from codebehind.

    
            // Window1.xaml.cs
    ImageSourceConverter imgsc = new ImageSourceConverter(); string path = @"Images\win2wpf.JPG"; ImageSource imageSource = (ImageSource)imgsc.ConvertFromString(path); img1.Source = imageSource;




    ProgressBar:


    Namespace : System.Windows.Controls.ProgressBar

    Designer Code:

    
            <ProgressBar Margin="10,10,0,13" Name="ProgressBar1" 
            HorizontalAlignment="Left" VerticalAlignment="Top" 
            Width="170" Height="30" />
            

    Code Behind:

    Setting value of Progressbar from code:

    
            // Window1.xaml.cs
    private void Window_Loaded(object sender, RoutedEventArgs e) { ProgressBar1.Value = 50; }





    Animation in Progressbar:

    
            // Window1.xaml.cs
    DoubleAnimation myDoubleAnimation = new DoubleAnimation(); myDoubleAnimation.From = 0; myDoubleAnimation.To = 300; myDoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(5)); myDoubleAnimation.AutoReverse = true; myDoubleAnimation.RepeatBehavior = RepeatBehavior.Forever; ProgressBar1.BeginAnimation(ProgressBar.ValueProperty, myDoubleAnimation);


    << Previous >> | << Next >>