Quantcast
Channel: WPF Tutorial
Browsing index pages (25 articles)

Image may be NSFW.
Clik here to view.

Set current date WPF calendar

WPF -> Calendarcalendar.DisplayDate = new DateTime(2020, 4, 17);calendar.SelectedDate = new DateTime(2020, 4, 17);

View Article


Image may be NSFW.
Clik here to view.

WPF Calendar SelectedDates

WPF->CalendarAdd multiple selected dates to WPF Calendar.<Grid>   <Calendar x:Name="calendar" /></Grid>calendar.SelectionMode = CalendarSelectionMode.MultipleRange;...

View Article


Image may be NSFW.
Clik here to view.

WPF TabControl Example

WPF -> Controls -> TabControl WPF TabControl elements display content on discrete pages accessed by selecting the appropriate tab.Example<Window x:Class="Agenda.MainWindow"...

View Article

DatePicker WPF Example

System.Windows.Controls -> DatePickerRepresents a control that allows the user to select a date.Example<Window x:Class="WpfApp4.MainWindow"...

View Article

Display XAML window in the second display WPF

WPF > Windows > Forms > ScreenAllScreens gets an array of all displays on the system.ExampleDisplay window in the second display WPFprivatevoid Window_Loaded(object sender, RoutedEventArgs e){...

View Article


Image may be NSFW.
Clik here to view.

GridViewColumnHeader WPF Example

WPF > Controls  > ContentControl > GridViewColumnHeaderGridViewColumnHeader object is a button control that is derived from ButtonBase. Column headers in a GridView view mode are...

View Article

Get Vertical ScrollBar Width WPF

WPF > Windows > SystemParameters> VerticalScrollBarWidthThis value indicates the width (in pixels) of a vertical scroll bar.SystemParameters.VerticalScrollBarWidth

View Article

WPF SystemParameters Class

WPF > Windows > SystemParametersVerticalScrollBarWidth

View Article


Bind Width to another Width control WPF

WPF > Binding > Width<Grid>  <Grid.ColumnDefinitions>    <ColumnDefinition Width="{Binding ElementName=controlName, Path=ActualWidth}"/>  </Grid.ColumnDefinitions>

View Article


ScrollToTop DataGrid WPF

WPF> DataGrid > Scroll To Topvar border = VisualTreeHelper.GetChild(myDataGrid, 0) asDecorator;if (border != null&& border.Child !=null){  var scrollViewer = border.Child asScrollViewer;...

View Article

FrameworkElementFactory focus on load element

WPF > FrameworkElementFactory > AddHandlerFrameworkElementFactory textBox = newFrameworkElementFactory(typeof(TextBox));textBox.AddHandler(TextBox.LoadedEvent,...

View Article

Disable row selection datagrid WPF

How to disable row selection in datagrid WPF?Answer:myDataGrid.IsHitTestVisible = false;

View Article

Find TextBox control ComboBox WPF

WPF > Controls > ItemsControl > ComboBoxUse FindName to find an element that has the provided identifier name.PART_EditableTextBoxTextBoxContains the text of the ComboBoxExamplevar textBox =...

View Article


Set DataGrid DataGridRow Background color WPF

WPF > DataGrid > DataGridRow > Background<DataGrid.RowStyle>  <Style TargetType="DataGridRow">    <Style.Triggers>      <DataTrigger Binding="{Binding IsValid}"...

View Article

Clear Sort WPF DataGrid

WPF > Controls > ItemsControl > DataGrid > Clear Sort_collectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGrid.Items);_collectionView.SortDescriptions.Clear();

View Article


Convert Hex to SolidColorBrush

WPF > System.Windows.Media > BrushConverterBrushConverter is used to convert a Brush object to or from another object type.Example:row.Background =...

View Article

Get Current Row WPF DataGrid

WPF > Controls > ItemsControl > DataGrid > ItemContainerGenerator > ContainerFromIndexReturns the element corresponding to the item at the given index.ExampleHow to get current row if...

View Article


Get rectangles from canvas WPF code behind

WPF > Controls > Layout > Canvas > ChildrenExample Get all rectangles from canvas.privateList<Rectangle> GetRectangles(){    return...

View Article

Round line WPF code behind

WPF > Line Line line = newLine{ Stroke = Brushes.Blue, StrokeThickness = 18, StrokeStartLineCap = PenLineCap.Round, StrokeEndLineCap = PenLineCap.Round, Height= 50, X1 = 50, X2 = 100, Y1 = 10, Y2 =...

View Article

Slider WPF Example

WPF > Controls > Slider     <Grid>        <TextBox            Text="{Binding ElementName=Slider, Path=Value,             UpdateSourceTrigger=PropertyChanged}"...

View Article
Browsing index pages (25 articles)


Latest Images