UWP Touch keyboard overlaps status bar - c#

Im devoloping a UWP app and I came across a problem.
In my input page when I tap a textbox the keyboard just "pushes" the UI upwards and this happens.
Normal screen:
Check at the top of the page, you can see the problem:
Does anyone know a fix for this? Thanks!

I think this is default behaviour of the keyboard and can't be changed.
If the keyboard would not push the content upwards, it would overlap the actual TextBox, which you want to fill with text.
If your problem is the statusbar getting overlapped/underlapped with the page-content, you could try to change the color of the statusbar, it seems to be transparent at the moment.
See this.

Related

WPF Programmatically Enable TextBox Scrolling/Panning for Tablets

I am working with a WPF application that will be used on Windows tablets. The issue I am having is that I cannot scroll through a large multi-line TextBox on a tablet by pressing and dragging the content. However, it still scrolls on a desktop with a mouse wheel.
This question (Enable swipe scrolling on Textbox control in WPF Scrollviewer) seems to answer the same problem I am having, but I need to do it programmatically. This is what I am doing to set the panning mode of the TextBox:
txtLongText.SetValue(ScrollViewer.PanningModeProperty, PanningMode.None);
Which I can tell is working because the click & drag text selection is now disabled, but the content still does not scroll. I am also setting the panning mode of the outer ScrollViewer as such:
popupScrollView.PanningMode = PanningMode.Both;
The popupScrollView object is then being set as the content inside a Popup.
The only thing I can think of is if there is somewhere else higher up that I need to be setting the panning mode? Any help would be appreciated. Thanks.
i have same problem with touch devices. i have a tricky way to handle this kind of issues
You have to handle touch event manually
i have written some codes to handle touch events manually
when UIElement_OnTouchDown(object sender, TouchEventArgs e) event occurred you can keep position of touched position by eventArgs.GetTouchPoint(this).Position.Y.
after that, you can determine is scroll happened or not by watching the position changes.
here is my sample gist
, i use this approach for same issue with touch devices
I think you require to use three properties to achieve this.
ScrollViewer.PanningMode
ScrollViewer.PanningDeceleration
ScrollViewer.PanningRatio
By default, PanningMode sets to None, but set it to another value will enable touch scrolling.
Another thing you can try is to set ScrollViewer CanContentScroll to true.
While Im not sure there is a viable way to solve that using wpf only, I recommend trying to implement html UI inside your wpf application using DoNetBrowser, link.
Then you can use the textarea control in html, which in default lets you scroll on mobile.
Hope this answer helped you.

Scrollbars automatic centering

I have a Form with height size bigger then screen, so the user can use the scrollbar to see the content. My problem is, I have alot of buttons and checkboxes, all the way up and down the form, and every time the user try to click some, the form automatic try to center the clicked button in the middle of screen.
I want the scrollbar to stay where the user put it. And not trying to automatic center at every btn or iten clicked.
Can someone help with this? Its winforms, visual studio 15.
I cannot reproduce your problem but have you tried overriding the ScrollToControl?
Stop form from scrolling when moving controls

WP8 keyboard handling

How to handle page completely going up when clicking on the text box in WP8. (During the time of focus goes to textbox) and Keyboard renders.I want to block header(page frame) going out of screen.
This is a known issue.
You can use something like that https://siphelper.codeplex.com/.
Or write you own code (based on this page) to put the layout down when keyboard is appearing.
When SIP keyboard is rendered, PhoneApplicationFrame.TranslateTransform.Y
is set to specific values (-259 in landscape orientation, -339 in portrait orientation).
To update layout, we’ll just set top margin to the specified value(-s) and
after that Silverlight layout system will fix the issue.
However, this is a common behavior for the platform. Users are familiar with it.

Balloon pop up over control mouse enter/exit

Hello,
Above is the program I am writing. On the right panel is basically two custom controls (the blue rectangle area) I created and just added them as controls to the background panel control when this winform program loads.
I used MS paint to draw out the pop up balloon that I want to see when my mouse enter this control's area. I want to do the following:
1. If mouse enter the control area, the yellow area balloon pop up and populate with the information of that specific control
2. If mouse move out of the control area, the pop up balloon disappear.
Can this be done with Winform application? I looked around and found out about Tooltip class but so far from researching I don't know if it does what I want to do.
I could be wrong but googling around gave me the impress that Tooltip offers very little in term of style. Ideally I want to make this pop up balloon into almost like a border-less pop up window where I can put image , font ect.....at will. Also Tooltip works if you hover over a button or specific field whereas I want the entire control area.
Can this be done? I appreciate if you can point me to any work around if there is one.
I wrote a comment, but I figure I'll expand it into a full answer. This is assuming you want a new control, which isn't a tooltip, for maximum customizability. I did something similar to this for work recently, to act as a non-modal info popup that disappears when clicked.
Creating a Custom Popup Form
What you want is essentially a floating popup that appears over your form, which means you'll want to define a new Form object, rather than a UserControl, as it won't actually be embedded within your other form.
Give it a multiline, non-editable textbox that you can fill with the information you want to populate, then simply call a new instance of the form on your Mouse_Enter event. Close it upon Mouse_Leave.
Adjusting The Style
You'll have to play with it a bit to get it to actually act like a popup and not just a window. I'd recommend setting it to a non-modal popup, and removing the border. You can write a function to automatically size it to its contents. I don't imagine you'll want the user manually resizing it.
Some other things to look into would be overriding the CreateParams property that comes with the basic Form object. You can force DropShadows and TopMost forms without making the form modal. Overriding ShowWithoutActivation to always return true will prevent the form from stealing focus when it pops up.
I'm not sure if you can pull off rounded edges like you have in your mockup. Perhaps you can pull it off with some wizardry in the OnPaint() function, but I couldn't tell you how to do it.
It might be a bit of a pain for fiddling around with, but you can get some good functionality and appearance out of it. If you think you can pull it off acceptably with the ToolTip class, go for it. It took me about a week to get my notifications where I wanted them (though I added several features that you probably don't need to worry about).
Examples
Some keywords to look up in related searches would be Toast Notification and Non-Modal Popup. This might be some use:
http://www.codeproject.com/Articles/442983/Android-Style-Toast-Notification-for-NET
Since you already have implemented custom user controls you might want to try it again. Make a control that is that style and color, changes it's size based on it's text. You can feed it information (such as the text to display) from your existing user control object. You can also have the mouse enter/leave code reside in your first user control.
If you're not sure how to make a rectangle with round corners you can either make it on the fly using a graphics object (which will turn into a bitmap on the screen) or make it how you want it to look in GIMP (or photoshop if you have it) then use that image as the background on your user control. Make the default background transparent (so your voids above the round corners are not grey). If you make a pre loaded image you'll need to be aware you will only be able to scale it equally in Y and X directions. unequal scaling will make it look distorted.
Can you use the Mouse_Enter event on the control?

Display Cursor in WPF TextBox without Focus

Is there anyway to make it look like a TextBox has focus when it really does not? I would like to display the flashing cursor in a WPF TextBox even though it does not have focus.
Why do I want to do this?
We have a system that accepts touch input from more than one user at a time. One of the users has focus and I cant have it jumping between controls. The secondn user input is from an on-screen keyboard. As they type the letters the text is entered in the textbox. It just looks strange for there not to be a cursor.
Well I think You can use animations for your TextBoxs, it will play all the time or at any time you want without being focused, hope it will help.

Categories

Resources