All Questions
690
questions
1
vote
1
answer
56
views
WPF TextBox select content on mouse click
For WPF TextBox I need to select all content of it in case of mouse click on it (in "real life" it will be touch on touchpad monitor).
For test I created simple project and check the ...
0
votes
1
answer
69
views
C# WPF ListView SelectedItem keep value on lost focus
Problem: Losing ListView Item focus and as a consequence reset of SelectedItem property when I try to push button on another panel different from panel with ListView. I need to keep focus (optional) ...
0
votes
0
answers
39
views
WPF Textbox : two textboxes, one need keybord focus and other needs selection of text using mouse
In User control,I have two textboxes
Textbox1 - readonly
Textbox2 - editable and it has focus now with code bellow
editableTextbox.CaretIndex = editableTextbox.Text.Length;
editableTextbox.Select(0, ...
0
votes
1
answer
201
views
Return keyboard focus
I have an application where the main window contains a user control, and inside that user control are items stored in an ItemsControl. Each item can be removed by clicking an 'x' button.
The problem I ...
2
votes
1
answer
535
views
How to focus on a newly added TabItem of a WPF TabControl?
I'm facing an issue where I need to be able to actually focus a TabItem tab in a TabControl like I would press the TAB key. I know I could use SendKeys.SendWait("{TAB}"); in order to achieve ...
0
votes
0
answers
184
views
WPF C# - Set focus to the last item of ItemsControl
In my WPF application, I have an items control, which includes text boxes and I also have a button which adds a new item to the items control.
And I want that the focus will be set to the new item.
I ...
0
votes
2
answers
208
views
How can I make a Grid that has tab stopping behavior?
I created a simple WPF UserControl that has a Grid as its Content control that reacts to MouseEnter, MouseLeave, and MouseDown events. Basically it is behaving like a button at this point, changing ...
1
vote
1
answer
681
views
Tab-focused button border color and style
I have this button in my User Control:
<Button
x:Name="OkButton"
Grid.Column="1"
Command="{Binding Confirm}"
IsDefault="True"
IsEnabled=&...
0
votes
1
answer
59
views
Mark a cell in my datagrid when the program starts
I can easily programmatically mark a cell in my datagrid using the following code:
DataGrid1.ScrollIntoView(DataGrid1.Items[Rowindex]);
DataGrid1.Focus(); ...
0
votes
1
answer
36
views
Why MainWindow doesn't take the focus from a Popup child
I have a problem when I'm using a Textbox in a Popup, opened from the MainWindow: if the MainWindow doesn't have the focus after the Popup has been opened, I'm not able to write something in the ...
0
votes
0
answers
26
views
How can I prevent WPF Viewbox component from "stealing" focus from main window? [duplicate]
I currently have a little WPF window that contains only a Viewbox, which itself contains a Calendar component (so that resizing the window resizes the calendar to match). The XAML for this is:
<...
0
votes
1
answer
154
views
wpf how to get program focus form windows
i made program it work in background, i want this program only work on program i select it
example : i created Auto clicker and i want to use this program just in games if the user go to any other ...
-1
votes
1
answer
51
views
Accessing rows not in focus in WPF DataGrid
I'm setting the style of unselected rows with Extended selection mode set up for my datagrid. This works fine for rows that are on the screen, but as you scroll up or down, the rows not in focus are ...
0
votes
1
answer
498
views
WPF application raises Activated event, but the application is not shown and not in focus
I have two applications. One of them is 3rd party, which sends messages to my WPF app. There are two types of messages: "hide" and "show".
On "hide", my app hides itself ...
0
votes
1
answer
187
views
IsKeyboardFocusWithin Popup
I use the IsKeyboardFocusWithin value to set IsSelected to ListViewItem in my layout.
So far it worked fine, until I discovered, that the Popup within my item doesn't pass IsKeyboardFocus value to its ...