WPF > Windows > SystemParameters > VerticalScrollBarWidth
This value indicates the width (in pixels) of a vertical scroll bar.
SystemParameters.VerticalScrollBarWidth
Search This Blog
Wednesday, July 12, 2017
Thursday, May 4, 2017
Bind Width to another Width control WPF
WPF > Binding > Width
 
<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition 
Width="{Binding ElementName=controlName, Path=ActualWidth}"/>
  </Grid.ColumnDefinitions>
Monday, March 13, 2017
ScrollToTop DataGrid WPF
WPF> DataGrid > Scroll To Top
var border = VisualTreeHelper.GetChild(myDataGrid,
0) as Decorator;
if (border != null && border.Child !=null)
{
  var scrollViewer =
border.Child as ScrollViewer;
 
if (scrollViewer != null)
 
{
 
  scrollViewer.ScrollToTop();
 
}
}
Labels:
DataGrid
Thursday, March 2, 2017
FrameworkElementFactory focus on load element
WPF > FrameworkElementFactory > AddHandler
 
FrameworkElementFactory textBox = new FrameworkElementFactory(typeof(TextBox));
textBox.AddHandler(TextBox.LoadedEvent, new RoutedEventHandler(OnTextBoxLoaded));
private void OnTextBoxLoaded(object sender, RoutedEventArgs e)
{
       TextBox textBox = sender as TextBox;
      
if (textBox != null)
      
{
      
       textBox.Focus();
      
}
}Tuesday, February 21, 2017
Disable row selection datagrid WPF
How to disable row selection in datagrid WPF?
Answer:
myDataGrid.IsHitTestVisible = false;
Labels:
DataGrid
Thursday, January 26, 2017
Find TextBox control ComboBox WPF
WPF > Controls > ItemsControl > ComboBox
Use FindName to find an element that has the provided identifier name.
Example
var textBox = comboBox.Template.FindName("PART_EditableTextBox", comboBox) as TextBox;
Use FindName to find an element that has the provided identifier name.
PART_EditableTextBox 
 | 
TextBox 
 | 
Contains the text of the ComboBox 
 | 
Example
var textBox = comboBox.Template.FindName("PART_EditableTextBox", comboBox) as TextBox;
Labels:
ComboBox
Subscribe to:
Comments (Atom)