h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

List of WPF Controls based on .Net Framework version

Here, I give  a control name and .Net framework in WPF.

Control Name.Net Framework
· AccessText 3.0 ,3.5,4.0,4.5
· Border Control 3.0 ,3.5,4.0,4.5
· Button Control 3.0 ,3.5,4.0,4.5
· BulletDecorator Control 3.0 ,3.5,4.0,4.5
· Canvas Control 3.0 ,3.5,4.0,4.5
· Calendar Control 4.0,4.5
· CheckBox Control 3.0 ,3.5,4.0,4.5
· ComboBox Control 3.0 ,3.5,4.0,4.5
· ContextMenu Control 3.0 ,3.5,4.0,4.5
· Datagrid Control 4.0,4.5
· DatePicker Control 4.0,4.5
· DockPanel Control 3.0 ,3.5,4.0,4.5
· DocumentViewer Control3.0 ,3.5,4.0,4.5
· Expander Control 3.0 ,3.5,4.0,4.5
· FlowDocumentPageviewer Control3.0 ,3.5,4.0,4.5
· FlowDocumentReader Control3.0 ,3.5,4.0,4.5
· FlowDocumentScrollviewer Control3.0 ,3.5,4.0,4.5
· Frame3.0 ,3.5,4.0,4.5
· Grid Control 3.0 ,3.5,4.0,4.5
· GridView Control3.0 ,3.5,4.0,4.5
· GridSplitter Control3.0 ,3.5,4.0,4.5
· GroupBox Control3.0 ,3.5,4.0,4.5
· Hyperlink3.0 ,3.5,4.0,4.5
· Image Control3.0 ,3.5,4.0,4.5
· InkCanvas Control3.0 ,3.5,4.0,4.5
· InkPresenter Control3.0 ,3.5,4.0,4.5
· Label3.0 ,3.5,4.0,4.5
· ListView Control 3.0 ,3.5,4.0,4.5
· ListBox Control3.0 ,3.5,4.0,4.5
· Menu 3.0 ,3.5,4.0,4.5
· MediaElement3.0 ,3.5,4.0,4.5
· NavigationWindow3.0 ,3.5,4.0,4.5
· OpenFiledialog Control3.0 ,3.5,4.0,4.5
· PasswordBox Control3.0 ,3.5,4.0,4.5
· Panel Control3.0 ,3.5,4.0,4.5
· Page3.0 ,3.5,4.0,4.5
· PrintDialog Control3.0 ,3.5,4.0,4.5
· Popup3.0 ,3.5,4.0,4.5
· ProgressBar3.0 ,3.5,4.0,4.5
· RadioButton3.0 ,3.5,4.0,4.5
· Repeated Control 3.0 ,3.5,4.0,4.5
· ResizeGrip Control3.0 ,3.5,4.0,4.5
· RichTextBox Control3.0 ,3.5,4.0,4.5
· SaveFileDialog Control3.0 ,3.5,4.0,4.5
· Separator Control3.0 ,3.5,4.0,4.5
· ScrollBar Control 3.0 ,3.5,4.0,4.5
· ScrollViewer Control 3.0 ,3.5,4.0,4.5
· Slider3.0 ,3.5,4.0,4.5
· SoundPlayerAction3.0 ,3.5,4.0,4.5
· StackPanel Control3.0 ,3.5,4.0,4.5
· StrickNoteControl3.0 ,3.5,4.0,4.5
· StatusBar3.0 ,3.5,4.0,4.5
· TabControl3.0 ,3.5,4.0,4.5
· TextBlock3.0 ,3.5,4.0,4.5
· TextBox Control3.0 ,3.5,4.0,4.5
· Thumb Control 3.0 ,3.5,4.0,4.5
· ToolTip3.0 ,3.5,4.0,4.5
· ToolBar3.0 ,3.5,4.0,4.5
· TreeviewControl3.0 ,3.5,4.0,4.5
· Viewbox Control3.0 ,3.5,4.0,4.5
· VirtualizingStackPanel Control3.0 ,3.5,4.0,4.5
· Window Control 3.0 ,3.5,4.0,4.5
· WrapPanel Control3.0 ,3.5,4.0,4.5

WPF Day-5

Introduction:
    Last Four days, we talked about WPF Introduction, AccessText Control, Board and Canvas, Calendar, CheckBox, ComboBox and ContextMenu Control. Today we will discuss about Datagrid, DatePicker, DockPanel, and DocumentViewer Control.

·  Datagrid Control:
               Represents a control that displays data in a customizable grid.
                  It starts from .Net Framework 4.0.
Please refer this: http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid%28v=vs.100%29.aspx
·  DatePicker Control:
               Represents a control that allows the user to select a date.
               It starts from .Net Framework 4.0.
Please refer this: http://msdn.microsoft.com/en-us/library/system.windows.controls.datepicker.aspx
·  DockPanel Control :
     Defines an area where you can arrange child elements either horizontally or vertically, relative to each other.
Create ContextMenu in XAML:
<DockPanel Background="AliceBlue">
            <TextBox Name="textBox1" TextWrapping="Wrap" Margin="10, 10, 5, 5" Grid.Row="7" Height="36" Width="202">The quick brown fox jumps over the lazy dog.
                <TextBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="_USA" />
                        <Separator />
                        <MenuItem Header="_INDIA"  />
                        <Separator />
                        <MenuItem Header="CHINA"/>
                        <Separator />
                        <MenuItem Header="SOUTH AFRICA" />
                    </ContextMenu>
                </TextBox.ContextMenu>
            </TextBox>
        </DockPanel>

Create ContextMenu in Coding:
    CheckBox chkYes;
     CheckBox chkNo;
     DockPanel dockPanel;
private void dockPanelControl()
        {
            dockPanel = new DockPanel();
            dockPanel.Background = Brushes.LightSlateGray;
            dockPanel.Margin = new Thickness(10, 15, 5, 10);
            dockPanel.Height = 100;
            dockPanel.Width= 200;
            dockControl(dockPanel);
            this.Content = dockPanel;
        }
        private void dockControl(DockPanel dpnl)
        {
            chkYes = new CheckBox();
            chkYes.ClickMode = ClickMode.Press;
            chkYes.Content = "Yes";
            chkYes.IsChecked = true;
            chkYes.Margin = new Thickness(10, 10, 25, 20);

            chkNo = new CheckBox();
            chkNo.ClickMode = ClickMode.Press;
            chkNo.Content = "No";
            chkNo.Margin = new Thickness(10, 10, 25, 20);
            dpnl.Children.Add(chkYes);
            dpnl.Children.Add(chkNo);
        }
private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dockPanelControl();
        }
·  DocumentViewer Control:
           Document viewing control that can host paginated FixedDocument content such as an XpsDocument. Simple says that user can view all documents like (PDF, text. Image files)
FixedDocument:
   It is a fixed format document with read Access for user.
    Provides a Package that holds the content of an XPS document.
Package:
           Container that can store multiple data objects.
Create ContextMenu in XAML:
<DocumentViewer Margin="20,12,12,26" Name="documentViewer1" Background="Azure" />
Create ContextMenu in Coding:
        DocumentViewer docViewer;
             private void documentViewerControl()
              {
                   docViewer = new DocumentViewer();
                   docViewer.Background = Brushes.LightSlateGray;
                    this.Content = docViewer;
        }
            private void Window_Loaded(object sender, RoutedEventArgs e)
             {
                 documentViewerControl();
             }
Conclusion:
  I hope, you to get some ideas about Datagrid, DatePicker, DockPanel, and DocumentViewer Control in WPF. Thanks for reading this article. We will talk about other controls in next Chapters.              

Create textBox using Class in C#.net

In this Article, I will explain Create a TextBox in the Class file and call the method in any form in the Application.
you can create a Class in the Several ways in the .Net.
you can create via "Class.cs" file.
you can create via "CodeFile.cs" file.
you can create via "Form.cs" file.
Now , i will explain One by one .

you can create via "Class.cs" file.:
Open your Project
Click "Project">> Add Class or Shift +Alt+C.
User can view the "Add New Item" window.
in the Name Input box , User can see the Class1.cs.
Click "ok" or change class file name in the input Box with Extension(.cs) and Clicks "Ok" button.
User can view this below format.

///Default namespaces
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Namespace_Program // Namespace Name
{
    class Class2 // Class name
    {
    }
}
Now , User add coding within the Class .
For Eg:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Namespace_Program
{
    class Class2  : Form  // We inherited form intoi class2
    {
       public static void TextBox(Form  frm)
        {
            TextBox txt = new TextBox();
            txt.Name = "txt_One";
            txt.Text = "Unit Testing";
            frm.Controls.Add(txt);
       }
    }
}

Now we just call this TextBox Method in the Form Class file
   Class2.TextBox(this);
Result: User can view the TextBox in the Form1 Designer at Run Time.
you can create via "CodeFile.cs" file:
we just create a method in the Class file using CodeFile.cs
using System;
using System.Windows.Forms;
namespace Test_namespace
{
    class dynamicControl : System.Windows.Forms.Form
    {
        public static void TextBox(Form frm)
        {
            TextBox txt = new TextBox();
            txt.Name = "txt_One";
            txt.Text = "Unit Testing";
            txt.Location = new System.Drawing.Point(20, 25);
            frm.Controls.Add(txt);
        }
    }
}
call in the Form.cs
 dynamicControl.TextBox(this);

you can create via "Form.cs" file:
open Form.cs
Copy and Paste code in the form.cs
    public static void TextBox(Form frm)
        {
            TextBox txt = new TextBox();
            txt.Name = "txt_One";
            txt.Text = "Testing";
            txt.Location = new Point(75, 100);
            frm.Controls.Add(txt);
        }
you can create via "Form.cs" file:
call the funciton in the form.cs
    TextBox(this);
I hope, this article helps you. Thanks for reading this Article.

WPF Day-4


Introduction:
    Last Three days, we talked about WPF Introduction, AccessText Control and Board . Today we will discuss about Canvas, Calendar, CheckBox, ComboBox and ContextMenu Control.
·  Canvas Control:
           It is a Layout panel.
     A Canvas panel is used to position child elements by using coordinates that are relative to the canvas area.
  Create Canvas in XAML:
<Canvas Background="BurlyWood" Margin="88,0,120,99" Height="66" VerticalAlignment="Bottom">
            <Button Name="btn_can" Margin="15,18,70,70" Height="26" Width="40" Canvas.Left="-1" Canvas.Top="17">Cancel</Button>
            <Button  Height="23" Margin="15,50,75,50" Name="btn_Ok" VerticalAlignment="Bottom" Click="btn_OK_Click" Width="39.893" Canvas.Left="-1" Canvas.Top="-44">OK</Button>
        </Canvas>
I just declare Buttons with in Canvas Tag.
Create Canvas in Coding:
          Canvas cans;
               private void canvas()
               {
                    cans = new Canvas();
          cans.Width = 150;
                              cans.Height = 150;
          cans.Background = Brushes.Lavender;
                    canvascontrols(cans);
                    this.Content = cans;
               }
     private void canvascontrols(Canvas cntCon)
              {
                  btn_Exit = new Button();
                  btn_Exit.Background = Brushes.Ivory;
                  btn_Exit.Content = "Exit";
                  btn_Exit.Name = "ButtonExit";
                  btn_Exit.Height = 30;
                  btn_Exit.Width = 50;
                  btn_Exit.Margin = new Thickness(10, 10, 20, 50);
                  btn_Exit.Click += new RoutedEventHandler(btn_Exit_Click);
                  cntCon.Children.Add(btn_Exit);
       }
   private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            canvas();
        }
Here, I created Method (canvascontrols) for adding a Button into Canvas.

·  Calendar Control:
Enable a user to select a date by using a visual calendar display.
It starts from .Net Framework 4.5.
Please refer this: http://msdn.microsoft.com/en-us/library/system.windows.controls.calendar.aspx
·  CheckBox Control:
                    User can select and clear.
Create Canvas in XAML:
<CheckBox Content="Yes" Background="Khaki" IsChecked="True" ></CheckBox>
Create Canvas in Coding:
          CheckBox chkYes;
          CheckBox chkNo;
       private void canvas()
        {
            cans = new Canvas();
            cans.Width = 150;
            cans.Height = 150;
            cans.Background = Brushes.Lavender;
            checkYesNoControls(cans);
            this.Content = cans;
        }
        private void checkYesNoControls(Canvas cntCon)
        {
            chkYes  = new CheckBox();
            chkYes.ClickMode = ClickMode.Press;
            chkYes.Content = "Yes";
            chkYes.Background = Brushes.Khaki;
            chkYes.IsChecked = true;
            chkYes.Margin = new Thickness(10, 10, 25, 20);
            cntCon.Children.Add(chkYes);
            chkNo = new CheckBox();
            chkNo.ClickMode = ClickMode.Press;
            chkNo.Content = "No";
            chkNo.Background = Brushes.LightGreen;
            chkNo.Margin = new Thickness(10, 40, 25, 20);
            cntCon.Children.Add(chkNo);
       }
private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            canvas();
        }
·  ComboBox Control:
            Selection control with a drop-down list that can be shown or hidden by clicking the arrow on the control.
Create ComboBox in XAML:
   <ComboBox Height="23" Margin="60,76,98,0" Name="comboBox1" VerticalAlignment="Top">
            <ComboBoxItem>IBM</ComboBoxItem>
            <ComboBoxItem>GANTEC</ComboBoxItem>
            <ComboBoxItem>INTEL</ComboBoxItem>
            <ComboBoxItem>HP</ComboBoxItem>
        </ComboBox>
Create ComboBox in Coding:
        ComboBox cmbCompany;
    private void comboBoxControls()
        {
            cmbCompany = new ComboBox();
            cmbCompany.Width = 100;
            cmbCompany.Height  = 20;
            cmbCompany.Margin = new Thickness(10, 5, 10, 20);
            cmbCompany.Items.Add("IBM");
            cmbCompany.Items.Add("SATHYAM");
            cmbCompany.Items.Add("KRISH");
            cmbCompany.Items.Add("GANTEC");
            this.Content = cmbCompany;
   }

private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            comboBoxControls ();
        }
  User can’t change the items in the ComboBox.It likes DropdownStyle in Windows Form
·  ContextMenu Control:
                    Represents a pop-up menu.
                   Control to expose functionality that is specific to the context of the control.
The following error message will show when user drag and drop a Context Menu in the window.






Create ContextMenu in XAML:
<TextBox Name="textBox1" TextWrapping="Wrap" Margin="10, 10, 5, 5" Grid.Row="7"> <TextBox.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="_USA" /><Separator />
                    <MenuItem Header="_INDIA"  /><Separator />
                    <MenuItem Header="CHINA"/><Separator />
                    <MenuItem Header="SOUTH AFRICA" /><Separator />
</ContextMenu>
            </TextBox.ContextMenu>
        </TextBox>

Create ContextMenu in Coding:
          TextBox txtBox;
   ContextMenu cntMenu;
   private void contentMenus(TextBox txtBox)
                    {
            cntMenu = new ContextMenu();
                                cntMenu.Items.Add("INDIA");
            cntMenu.Items.Add("USA");
                                cntMenu.Items.Add("CHINA");
                                cntMenu.Items.Add("SOUTH AFRICA");
                      cntMenu.Items.Add("JAPAN");
            txtBox.ContextMenu = cntMenu;
                    }
             private void TextBoxControl()
             {
                                txtBox = new TextBox();
            txtBox.Margin = new Thickness(11, 10, 10, 10);
                                txtBox.Width = 100;
            txtBox.Height = 25;
                                contentMenus(txtBox);
            this.Content = txtBox;
          }
private void Window_Loaded(object sender, RoutedEventArgs e)
          {
                                TextBoxControl();
          }
Conclusion:
  I hope, you get some ideas about Button and BulletDecorator Control in WPF. Thanks for reading this article. We will talk about other controls in next Chapters.