Keyboard shows up after textbbox clicked ,then the mobile view scrolls wrong - c#

The websites are MVC C# with kendo UI. It is no problem with the computer and ios phone(iphone) devices.But on Android, if the user clicked the website's textbox, the keyboard shows up and the websites scrolls, the user can not see the focus of the textbox. On the computer and ios phone, the user clicks the textbox,the view stands still and does not scroll. So I use the following CSS code on javascript of cshtml to fix:
#media screen and (max-width: 580px) and (max-height: 350px)and (min-height: 200px){
html {
display:block!important;
overflow:hidden!important;
}
}
If the textbox has clicked, the keyboard shows up and makes view smaller. While the view is smaller, the view can't scroll and it reveals the same correct view with a computer device and ios phone. But, it is only correct on some Android devices.So how can I use CSS to make the view of the website does not scroll when the keyboard shows up on Android phone device? Thanks!
The following is success case in ios phone device:
1.website
2.select event and open event window
3.Scroll down to the textbox
4.scroll down the textbox and focus the the end part of the text in textbox ,then keyboard shows up.It's no problem on this ios phone case ,but on android phone case,it will scroll up to wrong place.

Related

Text box Focus, Keep the Focus on text box no matter what in c#

I have a Bar code Scanning Application where the Scanner is a Plug and Play and decodes spits out the value. What I have is a text box in that is a Auto Post back and as soon as the Scanner scans the ID that goes into the text box and loads data.
The issue I am having is the text box is invisible and needs to have Focus on it no matter where every I click on the window or even switch tabs it needs to auto focus on it but when I switch tabs it losses focus what can I do here?
I have used
`txtID.Focus();
if (!IsPostBack)
{
txtID.Focus();
}`
But it still loses focus once its loaded. I am fairly new to c# and wasn't able to find any code that works with this.
Please let me know if you have any thing.

Programmatically open On-Screen Keyboard in UWP

Is it possible in UWP to force it to open the On Screen Keyboard (osk.exe)?
For example, in C# it is possible using System.Diagnostics.Process.Start("osk.exe");
Doing the above in UWP results in compile error saying there is no Process namespace.
I know that in Tablet mode, if I programmatically focus on a TextBox, it will show up the OnScreen keyboard.
But is it possible when in Desktop mode?
Is there a way for touchkeyboard to appear in desktop mode?
Ref the document in Keyboard interactions
Depending on the device, the touch keyboard appears when a text field or other editable text control gets focus, or when the user manually enables it through the Notification Center:
(source: s-msft.com)
Note The user might have to go to the Tablet mode screen in Settings > System and turn on "Make Windows more touch-friendly when using your device as a tablet" to enable the automatic appearance of the touch keyboard.
So the touch keyboard can appear automatically in tablet mode when users sets the input focus to a text control by using touch input. However, this won't happen in desktop mode and in UWP, there is no API to open it programmatically by now.
To show touch keyboard in desktop mode, we need the user manually enables it by clicking touch keyboard button and users can see this button by checking "Show touch keyboard button" in taskbar.
You are welcome to submit a request for this feature through UserVoice and Windows Feedback Hub app.
I was able to Show/Hide the On Screen Keyboard in Desktop Mode using:
CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Keyboard)
Code Sample:
.xaml:
<TextBox GotFocus="TextBox_OnGotFocus" LostFocus="TextBox_OnLostFocus" InputScope="Number"/>
.xaml.cs:
private void TextBox_OnGotFocus(object _, RoutedEventArgs __)
{
CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Keyboard);
}
private void TextBox_OnLostFocus(object _, RoutedEventArgs __)
{
CoreInputView.GetForCurrentView().TryHide();
}
Additionally, you can control the keyboard type by setting the InputScope with values like: Number, NumericPin, Text, or others:
https://learn.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Input.InputScopeNameValue

Orientation of PhoneApplicationPage not changing when message box is displayed WIndows phone

In my Windows phone application, when the message box is displayed and if the phone is rotated, only the message box is getting rotated, whereas the UI behind it remains in the previous orientation.
It seems like the "Orientation changed" event of the page is not getting triggered when the message box is being displayed.
Although the UI behind the message box is not so prominent, I could find that the native messaging app of windows phone follows this behavior. I mean if the message box is displayed and the orientation is changed, the list behind the message box is also changed.
This image is of the native messaging app.
This image is from my application
You can notice the list behind the both the images.
Can I get some help in achieving this behavior ?
MessageBox.Show(string msg) is a synchronized method, meaning the method won't return until you dismiss the message box by pushing one of its buttons. So UI thread is blocked, and the OrientationChanged is only handled after the message box is dismissed since the event handler is running on UI thread, too.
MessageDialog.ShowAsync, which is only available on Windows Phone 8.1, should not have this limitation.
One alternative to MessageBox is the Popup control. You can lay it on top of your page, and set it IsOpen to true/false to show/hide it. Make it look good on both Landscape and Portrait orientations using ViewStates, just like other normal controls.

Hyperlink or textblock with icon and text in windows phone 8

How can i put '<3 like' in a hyperlink in windows phone 8? <3 will be appbar icon.
I have tried to put image in text block but i could not succesful.
Look at the applicationbar sample that is in every new app you create. There you can see how an image is inserted as the background for a button. When the button is clicked you can use the webclient in windows phone to start the hyperlink.
For doing th hyperlink you have to look into how to create an URL, also. But it is pretty simple.

ProgressIndicator wraps content on page

Im creating an app where the startpage is an login screen. When user enter their credentials and finally taps the login button an Progressindicator Dialog is being shown. The dialog is based on an Window Popup. The window and the indicator works like a charm but there is one problem. The indicator is wraping the content on the page. So if you for example entered the wrong credentials and tapped the login button the inticator will dissapear to give the user one more chance to enter their right credentials. But when the indicator dissapear the Rememember Me Checkbox position is changed, it's getting placed over the login button. It seems like the Indicator Dialog is wraping the content on the page. Im a pretty good css & html developer so i wonder if there are something like in css called z-index or is it possible to set the position of the checkbox to absolute so its position aren't based upon other elements position. I used this guide to make this indicator.
http://blogs.msdn.com/b/priozersk/archive/2010/09/20/creating-progress-dialog-for-wp7.aspx
Thanks
Problem solved. As i copied the sample code from the orginal project to my own there was a few variables that i had to change the value of to work with my project. Including the height and the width of the object and so on. Anyway, it works like a charm now.

Categories

Resources