I have simple chat application with Rich Textbox to display messages and Textbox to write them. I'd like to have same behaviour as facebook chat does, which is having focus on the Textbox but being able to use mouse wheel to scroll the one I'm hovering over. So as an example: I'm writting something in the Textbox but in the meantime I want to scroll the Rich Textbox upwards by using my mousewheel without loosing focus on the Textbox. Facebook chat has this exact behaviour.
Semi pseudo code I came up with:
private void richTextBox_MouseOver(object sender, EventArgs e)
{
MouseWheelScroll -> richTextBox scroll, msgTextBox don't scroll
}
I confirm Dmitriy Zapevalov's insight, Windows 10 Operative System
has a new interesting feature:
Scroll inactive windows when I hover over them
This is exactly the behaviour you desire, I can confirm it works both
in Winform and WPF application and in general it is the behaviour of
any window I see on my monitor. It is enabled by default, user can
disable it.
It is a little bit tricky to reproduce that on c# applications
running on windows Xp, Vista, 7 or Windows 8, you can find that issue solved in C++ here and in manuell answer here
Related
We are using the windows form application on a tough pad (touchscreen device).
want to show the on screen key board when user click the text box or any input control , rather then handling this event is there any way to handle this on the application level to show and hide the windows on screen keyboard
DevExpress editors, as well as regular .NET editors, do not affect OnScreenKeyboard's behavior. I suggest that you use one of the approaches described here to display it - Automatically pop up tablet touch keyboard on WinForms input focus.
What i want to do:
I want my WPF app to successfully type in keystrokes onto any other application that has text fields, for example, notepad.
What the problem is:
If i press any button that simulates a keystroke ('A', for example), my app steals focus and now that 'notepad' is not focused/active anymore, my button does not know where to send the keystroke,
What im requesting: How do i get my WPF app to not steal the focus of any other app so that i can successfully type in a keystroke when i press my app's buttons, here's my code:
private void button_Click(object sender, RoutedEventArgs e)
{
InputSimulator.SimulateTextEntry("1");
}
'InputSimulator' comes from a library that i got online, it makes simulating keystrokes easy.
**Update, for clarification, i want something like Surface Pro Keyboard, this keyboard does exactly what i want to do, if i press on it's keyboard, the app that is currently active stays focused and sp3 keyboard is able to enter a keystroke, how do i do this for MY app?
You'll need to p/invoke user32.dll, use FindWindow to get a handle for the application you are trying to write to, then use SetForegroundWindow. Then you can send keystrokes to that window.
See the article on MSDN for a quick sample: https://msdn.microsoft.com/en-us/library/ms171548.aspx
You can also find tons of examples by searching google for p/invoke and Windows API.
I'm trying to replicate some of the nice functionality of the To, Cc, and Bcc controls that can be seen when composing a new email in the Mail app on Windows Phone 8.1. Whenever one of the fields receives focus, it is moved to the very top of the screen. This happens so that the popup showing auto-complete suggestions has as much space as possible. How is this accomplished?
I believe this behavior can be hacked together using a ScrollViewer and ScrollViewer.ChangeView(), but I am hoping there is a better, friendlier framework method to do this.
Im trying some different alternatives for onscreen keyboard for our desktop application that is being run on a windows 8 tablet without keyboard.
So far Tabtip.exe have been working best but im open to other solutions.
The problem i have is when the user clicks on a textbox in the application and i show the onscreen keyboard, the keyboard hides the textbox.
How do fix this in a good way?
Is it something that windows can handle automatically? Some applications like outlook and word gets a "splitscreen" with a scroll bar in the upper part where the applications is and the keyboard in the lower part. I want a solution like that to. How do they do it?
One solution could be to always move my window up a set amount of pixels that is the same as the keyboard height. But i don't want to move the application if the keyboard doesn't cover the textbox.
But how do i determine how high the keyboard is? is it always the same height? How do i detect where the window is?
Any other solutions?
I am pretty new to Windows Phone, XAML and such and I am trying to solve this. I have custom colored button, but while this button is pressed it changes its color. How to customize this "pressed" color/properties? Is there any simple way that I missed? I was searching over the internet but nothing helped.
You need to know about styles, states and many other stuff, it's simple but you need to learn, you can go through this sample code from MSDN to create a Windows Phone Custom Style Button