添加数字键盘与字母键盘。数字键盘包含输入限制功能。步骤设置页面使用数字键盘。
This commit is contained in:
commit
37192378b0
8 files changed
+775
-103
No files matched your search
@@ -202,10 +202,10 @@
|
|||||||
<Compile Include="Windows\Sampling.xaml.cs">
|
<Compile Include="Windows\Sampling.xaml.cs">
|
||||||
<DependentUpon>Sampling.xaml</DependentUpon>
|
<DependentUpon>Sampling.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Windows\TouchKeyboardNumeral.xaml.cs">
|
<Compile Include="KEY\TouchKeyboardNumeral.xaml.cs">
|
||||||
<DependentUpon>TouchKeyboardNumeral.xaml</DependentUpon>
|
<DependentUpon>TouchKeyboardNumeral.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Windows\TouchKeyboard.xaml.cs">
|
<Compile Include="KEY\TouchKeyboard.xaml.cs">
|
||||||
<DependentUpon>TouchKeyboard.xaml</DependentUpon>
|
<DependentUpon>TouchKeyboard.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Windows\UserInf.xaml.cs">
|
<Compile Include="Windows\UserInf.xaml.cs">
|
||||||
@@ -292,11 +292,11 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Windows\TouchKeyboardNumeral.xaml">
|
<Page Include="KEY\TouchKeyboardNumeral.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Windows\TouchKeyboard.xaml">
|
<Page Include="KEY\TouchKeyboard.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<Window x:Class="DyeingComputer.Windows.TouchKeyboard"
|
<Window x:Class="DyeingComputer.KEY.TouchKeyboard"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
@@ -12,7 +12,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace DyeingComputer.Windows
|
namespace DyeingComputer.KEY
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TouchKeyboard.xaml 的交互逻辑
|
/// TouchKeyboard.xaml 的交互逻辑
|
||||||
@@ -1,12 +1,17 @@
|
|||||||
<Window x:Class="DyeingComputer.Windows.TouchKeyboardNumeral"
|
<Window x:Class="DyeingComputer.KEY.TouchKeyboardNumeral"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:DyeingComputer.Windows"
|
xmlns:local="clr-namespace:DyeingComputer.Windows"
|
||||||
mc:Ignorable="d" WindowStyle="None" ResizeMode="NoResize" Topmost="True"
|
mc:Ignorable="d"
|
||||||
|
WindowStyle="None"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
Topmost="True"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Title="TouchKeyboardNumeral" Height="500" Width="550">
|
Title="TouchKeyboardNumeral"
|
||||||
|
Loaded="Window_Loaded"
|
||||||
|
Height="500" Width="550">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style x:Key="KeyButtonStyle" TargetType="Button">
|
<Style x:Key="KeyButtonStyle" TargetType="Button">
|
||||||
<Setter Property="Background" Value="#FFF0F0F0"/>
|
<Setter Property="Background" Value="#FFF0F0F0"/>
|
||||||
@@ -63,7 +68,7 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- 数字行 -->
|
<!-- 数字行 -->
|
||||||
<StackPanel Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Center">
|
<StackPanel x:Name="FirstRow" Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Center">
|
||||||
<Button Content="7" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
<Button Content="7" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
||||||
<Button Content="8" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
<Button Content="8" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
||||||
<Button Content="9" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
<Button Content="9" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
||||||
@@ -71,8 +76,8 @@
|
|||||||
<Button Content="DEL" Style="{StaticResource SpecialKeyButtonStyle}" Click="Backspace_Click" Width="60"/>
|
<Button Content="DEL" Style="{StaticResource SpecialKeyButtonStyle}" Click="Backspace_Click" Width="60"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- 第一行字母 -->
|
<!-- 数字行 -->
|
||||||
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
|
<StackPanel x:Name="SecondRow" Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
|
||||||
<Button Content="4" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
<Button Content="4" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
||||||
<Button Content="5" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
<Button Content="5" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
||||||
<Button Content="6" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
<Button Content="6" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
||||||
@@ -80,20 +85,13 @@
|
|||||||
<Button Content="HIDE" Style="{StaticResource SpecialKeyButtonStyle}" Click="Hide_Click" Width="60"/>
|
<Button Content="HIDE" Style="{StaticResource SpecialKeyButtonStyle}" Click="Hide_Click" Width="60"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- 第二行字母 -->
|
<!-- 数字行 -->
|
||||||
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Center">
|
<StackPanel x:Name="ThirdRow" Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Center">
|
||||||
<Button Content="1" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
<Button Content="1" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
||||||
<Button Content="2" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
<Button Content="2" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
||||||
<Button Content="3" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
<Button Content="3" Style="{StaticResource KeyButtonStyle}" Click="KeyButton_Click"/>
|
||||||
<Button Content="ENTER" Style="{StaticResource SpecialKeyButtonStyle}" Click="Enter_Click" Width="200"/>
|
<Button Content="ENTER" Style="{StaticResource SpecialKeyButtonStyle}" Click="Enter_Click" Width="200"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- 状态栏 -->
|
|
||||||
<StatusBar Grid.Row="2">
|
|
||||||
<StatusBarItem>
|
|
||||||
<TextBlock x:Name="StatusTextBlock" Text="就绪"/>
|
|
||||||
</StatusBarItem>
|
|
||||||
</StatusBar>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -0,0 +1,214 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace DyeingComputer.KEY
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// TouchKeyboard.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class TouchKeyboardNumeral : Window
|
||||||
|
{
|
||||||
|
private bool isShiftActive = false;
|
||||||
|
private bool isSymbolActive = false;
|
||||||
|
public string KeyValue;
|
||||||
|
public event EventHandler<KeyPressedEventArgs> KeyPressed;
|
||||||
|
private KeyboardMode currentMode = KeyboardMode.Default;
|
||||||
|
private int minValue = 0;
|
||||||
|
private int maxValue = 9;
|
||||||
|
private TextBox targetTextBox;
|
||||||
|
// 定义键盘模式枚举
|
||||||
|
public enum KeyboardMode
|
||||||
|
{
|
||||||
|
Default, // 默认模式,所有键可用
|
||||||
|
NumericOnly, // 只允许数字
|
||||||
|
DecimalOnly, // 允许数字和小数点
|
||||||
|
LimitedRange // 限制数字范围
|
||||||
|
}
|
||||||
|
|
||||||
|
public TouchKeyboardNumeral()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
public void SetKeyboardMode(KeyboardMode mode, TextBox target = null, int min = 0, int max = 9)
|
||||||
|
{
|
||||||
|
currentMode = mode;
|
||||||
|
targetTextBox = target;
|
||||||
|
minValue = min;
|
||||||
|
maxValue = max;
|
||||||
|
|
||||||
|
UpdateKeyboardLayout();
|
||||||
|
}
|
||||||
|
private void UpdateKeyboardLayout()
|
||||||
|
{
|
||||||
|
switch (currentMode)
|
||||||
|
{
|
||||||
|
case KeyboardMode.NumericOnly:
|
||||||
|
// 只允许数字,禁用小数点
|
||||||
|
SetButtonEnabled(".", false);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KeyboardMode.DecimalOnly:
|
||||||
|
// 允许数字和小数点
|
||||||
|
SetButtonEnabled(".", true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KeyboardMode.LimitedRange:
|
||||||
|
// 根据范围启用/禁用数字键
|
||||||
|
for (int i = 0; i <= 9; i++)
|
||||||
|
{
|
||||||
|
SetButtonEnabled(i.ToString(), i >= minValue && i <= maxValue);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KeyboardMode.Default:
|
||||||
|
default:
|
||||||
|
// 启用所有键
|
||||||
|
foreach (var element in FirstRow.Children)
|
||||||
|
{
|
||||||
|
if (element is Button button && char.IsDigit(button.Content.ToString()[0]))
|
||||||
|
button.IsEnabled = true;
|
||||||
|
}
|
||||||
|
foreach (var element in SecondRow.Children)
|
||||||
|
{
|
||||||
|
if (element is Button button && (char.IsDigit(button.Content.ToString()[0]) || button.Content.ToString() == "."))
|
||||||
|
button.IsEnabled = true;
|
||||||
|
}
|
||||||
|
foreach (var element in ThirdRow.Children)
|
||||||
|
{
|
||||||
|
if (element is Button button && char.IsDigit(button.Content.ToString()[0]))
|
||||||
|
button.IsEnabled = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置按钮启用状态
|
||||||
|
private void SetButtonEnabled(string content, bool enabled)
|
||||||
|
{
|
||||||
|
// 在第一行查找
|
||||||
|
foreach (var element in FirstRow.Children)
|
||||||
|
{
|
||||||
|
if (element is Button button && button.Content.ToString() == content)
|
||||||
|
{
|
||||||
|
button.IsEnabled = enabled;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 在第二行查找
|
||||||
|
foreach (var element in SecondRow.Children)
|
||||||
|
{
|
||||||
|
if (element is Button button && button.Content.ToString() == content)
|
||||||
|
{
|
||||||
|
button.IsEnabled = enabled;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 在第三行查找
|
||||||
|
foreach (var element in ThirdRow.Children)
|
||||||
|
{
|
||||||
|
if (element is Button button && button.Content.ToString() == content)
|
||||||
|
{
|
||||||
|
button.IsEnabled = enabled;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数字键点击事件
|
||||||
|
private void KeyButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Button button = sender as Button;
|
||||||
|
if (button != null && button.IsEnabled)
|
||||||
|
{
|
||||||
|
string keyValue = button.Content.ToString();
|
||||||
|
PreviewTextBox.Text += keyValue;
|
||||||
|
|
||||||
|
// 触发按键事件
|
||||||
|
// KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Character, keyValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 退格键点击事件
|
||||||
|
private void Backspace_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (PreviewTextBox.Text.Length > 0)
|
||||||
|
{
|
||||||
|
PreviewTextBox.Text = PreviewTextBox.Text.Substring(0, PreviewTextBox.Text.Length - 1);
|
||||||
|
|
||||||
|
// 触发退格事件
|
||||||
|
// KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Backspace, ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 回车键点击事件
|
||||||
|
private void Enter_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// 触发回车事件
|
||||||
|
KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Enter, PreviewTextBox.Text));
|
||||||
|
|
||||||
|
// 隐藏键盘
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 隐藏键点击事件
|
||||||
|
private void Hide_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// KeyPressed?.Invoke(this, new KeyPressedEventArgs(KeyType.Hide, ""));
|
||||||
|
// 隐藏键盘
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class KeyPressedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public KeyType KeyType { get; }
|
||||||
|
public string KeyValue { get; }
|
||||||
|
|
||||||
|
public KeyPressedEventArgs(KeyType keyType, string keyValue)
|
||||||
|
{
|
||||||
|
KeyType = keyType;
|
||||||
|
KeyValue = keyValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// 初始化为默认模式
|
||||||
|
SetKeyboardMode(KeyboardMode.Default);
|
||||||
|
PreviewTextBox.Text = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 按键类型枚举
|
||||||
|
public enum KeyType
|
||||||
|
{
|
||||||
|
Character,
|
||||||
|
Backspace,
|
||||||
|
Enter,
|
||||||
|
Hide
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按键事件参数
|
||||||
|
public class KeyPressedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public KeyType KeyType { get; }
|
||||||
|
public string KeyValue { get; }
|
||||||
|
public string DATValue { set; get; }
|
||||||
|
|
||||||
|
public KeyPressedEventArgs(KeyType keyType, string keyValue)
|
||||||
|
{
|
||||||
|
KeyType = keyType;
|
||||||
|
KeyValue = keyValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace DyeingComputer.Windows
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// TouchKeyboard.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class TouchKeyboardNumeral : Window
|
|
||||||
{
|
|
||||||
private bool isShiftActive = false;
|
|
||||||
private bool isSymbolActive = false;
|
|
||||||
public string KeyValue;
|
|
||||||
|
|
||||||
public TouchKeyboardNumeral()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void KeyButton_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
Button button = sender as Button;
|
|
||||||
if (button != null)
|
|
||||||
{
|
|
||||||
string key = button.Content.ToString();
|
|
||||||
|
|
||||||
if (key.Length == 1 && char.IsLetter(key[0]))
|
|
||||||
{
|
|
||||||
key = isShiftActive ? key.ToUpper() : key.ToLower();
|
|
||||||
}
|
|
||||||
|
|
||||||
PreviewTextBox.Text += key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Backspace_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(PreviewTextBox.Text))
|
|
||||||
{
|
|
||||||
PreviewTextBox.Text = PreviewTextBox.Text.Substring(0, PreviewTextBox.Text.Length - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Enter_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
KeyValue = PreviewTextBox.Text;
|
|
||||||
this.Close();
|
|
||||||
// PreviewTextBox.Text += Environment.NewLine;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Hide_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+15
-10
@@ -44,35 +44,40 @@
|
|||||||
<TextBox x:Name="P1" HorizontalAlignment="Right" Height="30" Margin="0,120,10,0"
|
<TextBox x:Name="P1" HorizontalAlignment="Right" Height="30" Margin="0,120,10,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||||
Text="0" PreviewTextInput="Tb_KeyP1" InputMethod.IsInputMethodEnabled="False"
|
Text="0" PreviewTextInput="Tb_KeyP1" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P1_TextChanged"/>
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P1_TextChanged"
|
||||||
|
GotFocus="P1_GotFocus"/>
|
||||||
<TextBlock x:Name="P2N" HorizontalAlignment="Left" Height="30" Margin="210,155,0,0"
|
<TextBlock x:Name="P2N" HorizontalAlignment="Left" Height="30" Margin="210,155,0,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
||||||
Background="#FFEFEEEE" Visibility="Hidden"/>
|
Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||||
<TextBox x:Name="P2" HorizontalAlignment="Right" Height="30" Margin="0,155,10,0"
|
<TextBox x:Name="P2" HorizontalAlignment="Right" Height="30" Margin="0,155,10,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||||
Text="0" PreviewTextInput="Tb_KeyP2" InputMethod.IsInputMethodEnabled="False"
|
Text="0" PreviewTextInput="Tb_KeyP2" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P2_TextChanged"/>
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P2_TextChanged"
|
||||||
|
GotFocus="P2_GotFocus"/>
|
||||||
<TextBlock x:Name="P3N" HorizontalAlignment="Left" Height="30" Margin="210,190,0,0"
|
<TextBlock x:Name="P3N" HorizontalAlignment="Left" Height="30" Margin="210,190,0,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
||||||
Background="#FFEFEEEE" Visibility="Hidden"/>
|
Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||||
<TextBox x:Name="P3" HorizontalAlignment="Right" Height="30" Margin="0,190,10,0"
|
<TextBox x:Name="P3" HorizontalAlignment="Right" Height="30" Margin="0,190,10,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||||
Text="0" PreviewTextInput="Tb_KeyP3" InputMethod.IsInputMethodEnabled="False"
|
Text="0" PreviewTextInput="Tb_KeyP3" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P3_TextChanged"/>
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P3_TextChanged"
|
||||||
|
GotFocus="P3_GotFocus"/>
|
||||||
<TextBlock x:Name="P4N" HorizontalAlignment="Left" Height="30" Margin="210,225,0,0"
|
<TextBlock x:Name="P4N" HorizontalAlignment="Left" Height="30" Margin="210,225,0,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
||||||
Background="#FFEFEEEE" Visibility="Hidden"/>
|
Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||||
<TextBox x:Name="P4" HorizontalAlignment="Right" Height="30" Margin="0,225,10,0"
|
<TextBox x:Name="P4" HorizontalAlignment="Right" Height="30" Margin="0,225,10,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||||
Text="0" PreviewTextInput="Tb_KeyP4" InputMethod.IsInputMethodEnabled="False"
|
Text="0" PreviewTextInput="Tb_KeyP4" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P4_TextChanged"/>
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P4_TextChanged"
|
||||||
|
GotFocus="P4_GotFocus"/>
|
||||||
<TextBlock x:Name="P5N" HorizontalAlignment="Left" Height="30" Margin="210,260,0,0"
|
<TextBlock x:Name="P5N" HorizontalAlignment="Left" Height="30" Margin="210,260,0,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
||||||
Background="#FFEFEEEE" Visibility="Hidden"/>
|
Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||||
<TextBox x:Name="P5" HorizontalAlignment="Right" Height="30" Margin="0,260,10,0"
|
<TextBox x:Name="P5" HorizontalAlignment="Right" Height="30" Margin="0,260,10,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1" ClipToBounds="True"
|
||||||
Text="0" PreviewTextInput="Tb_KeyP5" InputMethod.IsInputMethodEnabled="False"
|
Text="0" PreviewTextInput="Tb_KeyP5" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P5_TextChanged"/>
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" TextChanged="P5_TextChanged"
|
||||||
|
GotFocus="P5_GotFocus"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid Grid.Row="1">
|
<Grid Grid.Row="1">
|
||||||
@@ -107,7 +112,7 @@
|
|||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
||||||
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP1p"
|
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP1p"
|
||||||
TextChanged="P1P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
TextChanged="P1P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" GotFocus="P1P_GotFocus"/>
|
||||||
<TextBlock x:Name="P2NP" HorizontalAlignment="Left" Height="30" Margin="210,205,0,0"
|
<TextBlock x:Name="P2NP" HorizontalAlignment="Left" Height="30" Margin="210,205,0,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
||||||
Background="#FFEFEEEE" Visibility="Hidden"/>
|
Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||||
@@ -115,7 +120,7 @@
|
|||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
||||||
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP2p"
|
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP2p"
|
||||||
TextChanged="P2P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
TextChanged="P2P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" GotFocus="P2P_GotFocus"/>
|
||||||
<TextBlock x:Name="P3NP" HorizontalAlignment="Left" Height="30" Margin="210,240,0,0"
|
<TextBlock x:Name="P3NP" HorizontalAlignment="Left" Height="30" Margin="210,240,0,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
||||||
Background="#FFEFEEEE" Visibility="Hidden"/>
|
Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||||
@@ -123,7 +128,7 @@
|
|||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
||||||
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP3p"
|
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP3p"
|
||||||
TextChanged="P3P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
TextChanged="P3P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" GotFocus="P3P_GotFocus"/>
|
||||||
<TextBlock x:Name="P4NP" HorizontalAlignment="Left" Height="30" Margin="210,275,0,0"
|
<TextBlock x:Name="P4NP" HorizontalAlignment="Left" Height="30" Margin="210,275,0,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
||||||
Background="#FFEFEEEE" Visibility="Hidden"/>
|
Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||||
@@ -131,7 +136,7 @@
|
|||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
||||||
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP4p"
|
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP4p"
|
||||||
TextChanged="P4P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
TextChanged="P4P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" GotFocus="P4P_GotFocus"/>
|
||||||
<TextBlock x:Name="P5NP" HorizontalAlignment="Left" Height="30" Margin="210,310,0,0"
|
<TextBlock x:Name="P5NP" HorizontalAlignment="Left" Height="30" Margin="210,310,0,0"
|
||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="20"
|
||||||
Background="#FFEFEEEE" Visibility="Hidden"/>
|
Background="#FFEFEEEE" Visibility="Hidden"/>
|
||||||
@@ -139,7 +144,7 @@
|
|||||||
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
TextWrapping="Wrap" VerticalAlignment="Top" Width="230" MaxLines="1"
|
||||||
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP5p"
|
ClipToBounds="True" Text="0" PreviewTextInput="Tb_KeyP5p"
|
||||||
TextChanged="P5P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
TextChanged="P5P_TextChanged" InputMethod.IsInputMethodEnabled="False"
|
||||||
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" />
|
FontSize="20" HorizontalContentAlignment="Right" Visibility="Hidden" GotFocus="P5P_GotFocus"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Button Grid.Row="2" x:Name="yes" Content="{x:Static lang:Resources.YES}"
|
<Button Grid.Row="2" x:Name="yes" Content="{x:Static lang:Resources.YES}"
|
||||||
|
|||||||
+527
-4
@@ -1,4 +1,5 @@
|
|||||||
using DyeingComputer.View;
|
using DyeingComputer.KEY;
|
||||||
|
using DyeingComputer.View;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@@ -11,7 +12,6 @@ using System.Windows;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
@@ -27,6 +27,8 @@ namespace DyeingComputer.Windows
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ViewStep : Window
|
public partial class ViewStep : Window
|
||||||
{
|
{
|
||||||
|
private TouchKeyboardNumeral numeralKeyboard;
|
||||||
|
private TextBox currentTextBox;
|
||||||
public string data { get; set; }
|
public string data { get; set; }
|
||||||
private int dat_P = 0;
|
private int dat_P = 0;
|
||||||
//声明一个更新Address的委托
|
//声明一个更新Address的委托
|
||||||
@@ -343,7 +345,7 @@ namespace DyeingComputer.Windows
|
|||||||
|
|
||||||
|
|
||||||
private readonly string[] id_dat = {"001","007","008","013","015" , "020", "022", "031", "035", "036",
|
private readonly string[] id_dat = {"001","007","008","013","015" , "020", "022", "031", "035", "036",
|
||||||
"039", "040", "041", "049", "050", "051", "054", "055", "056","064","065","066","067", "090","091",
|
"039", "040", "041", "049", "050", "051", "054", "055", "056","064","065","066","067", "090",
|
||||||
"093","094" };
|
"093","094" };
|
||||||
private readonly string[] id_datp = {" " ,"017", "050", "051", "064", "066","090","091", "093","094" };
|
private readonly string[] id_datp = {" " ,"017", "050", "051", "064", "066","090","091", "093","094" };
|
||||||
|
|
||||||
@@ -373,7 +375,6 @@ namespace DyeingComputer.Windows
|
|||||||
this.boxID.Items.Add(Properties.Resources.CallDistribution);//呼叫输送066
|
this.boxID.Items.Add(Properties.Resources.CallDistribution);//呼叫输送066
|
||||||
this.boxID.Items.Add(Properties.Resources.CallPreparation);//呼叫准备067
|
this.boxID.Items.Add(Properties.Resources.CallPreparation);//呼叫准备067
|
||||||
this.boxID.Items.Add(Properties.Resources.RapidAcidAddition);//快速加酸090
|
this.boxID.Items.Add(Properties.Resources.RapidAcidAddition);//快速加酸090
|
||||||
this.boxID.Items.Add(Properties.Resources.PHTemperatureControl);//ph温度控制091
|
|
||||||
this.boxID.Items.Add(Properties.Resources.PHDetection);//ph检测093
|
this.boxID.Items.Add(Properties.Resources.PHDetection);//ph检测093
|
||||||
this.boxID.Items.Add(Properties.Resources.PHControl);//ph控制094
|
this.boxID.Items.Add(Properties.Resources.PHControl);//ph控制094
|
||||||
|
|
||||||
@@ -1727,5 +1728,527 @@ namespace DyeingComputer.Windows
|
|||||||
P4P.Text = dat_D.Field<double>("Parameter4_S3").ToString();
|
P4P.Text = dat_D.Field<double>("Parameter4_S3").ToString();
|
||||||
P5P.Text = dat_D.Field<double>("Parameter5_S3").ToString();
|
P5P.Text = dat_D.Field<double>("Parameter5_S3").ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void P1_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAME.Text)
|
||||||
|
{
|
||||||
|
case "001":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "007":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "008":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "013":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "015":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "017":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "020":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "022":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "031":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "050":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "051":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "064":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "065":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "066":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "067":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "090":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "091":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "093":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "094":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
}
|
||||||
|
private void P2_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAME.Text)
|
||||||
|
{
|
||||||
|
case "001":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "007":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "008":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "013":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "015":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "017":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "020":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "022":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "050":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "051":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "064":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "065":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "066":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "090":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "091":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "094":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
}
|
||||||
|
private void P3_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAME.Text)
|
||||||
|
{
|
||||||
|
case "001":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "013":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "015":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "017":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "064":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "065":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "066":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "091":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
}
|
||||||
|
private void P4_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAME.Text)
|
||||||
|
{
|
||||||
|
case "013":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "017":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "064":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
}
|
||||||
|
private void P5_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAME.Text)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
}
|
||||||
|
private void P1P_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAMEp.Text)
|
||||||
|
{
|
||||||
|
case "001":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "007":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "008":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "013":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "015":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "017":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "020":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "022":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "031":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "050":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "051":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "064":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "065":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "066":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "067":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "090":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "091":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "093":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "094":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
}
|
||||||
|
private void P2P_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAME.Text)
|
||||||
|
{
|
||||||
|
case "001":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "007":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "008":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "013":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "015":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "017":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "020":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "022":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "050":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "051":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "064":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "065":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "066":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 3);
|
||||||
|
break;
|
||||||
|
case "090":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "091":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "094":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
}
|
||||||
|
private void P3P_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAME.Text)
|
||||||
|
{
|
||||||
|
case "001":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "013":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "015":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "017":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "064":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "065":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "066":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "091":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
|
||||||
|
}
|
||||||
|
private void P4P_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAME.Text)
|
||||||
|
{
|
||||||
|
case "013":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.LimitedRange, currentTextBox, 1, 4);
|
||||||
|
break;
|
||||||
|
case "017":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
case "064":
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.NumericOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
}
|
||||||
|
private void P5P_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
currentTextBox = sender as TextBox;
|
||||||
|
if (numeralKeyboard == null)
|
||||||
|
{
|
||||||
|
numeralKeyboard = new TouchKeyboardNumeral();
|
||||||
|
numeralKeyboard.KeyPressed += NumeralKeyboard_KeyPressed;
|
||||||
|
numeralKeyboard.Closed += (s, args) => { numeralKeyboard = null; };
|
||||||
|
}
|
||||||
|
switch (boxNAME.Text)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
numeralKeyboard.SetKeyboardMode(TouchKeyboardNumeral.KeyboardMode.DecimalOnly, currentTextBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 显示键盘
|
||||||
|
numeralKeyboard.Show();
|
||||||
|
// 定位键盘位置(在主窗口下方)
|
||||||
|
UpdateKeyboardPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新键盘位置
|
||||||
|
private void UpdateKeyboardPosition()
|
||||||
|
{
|
||||||
|
if (numeralKeyboard == null) return;
|
||||||
|
|
||||||
|
// 获取主窗口的位置
|
||||||
|
var mainWindowLeft = this.Left;
|
||||||
|
var mainWindowTop = this.Top;
|
||||||
|
var mainWindowWidth = this.Width;
|
||||||
|
var mainWindowHeight = this.Height;
|
||||||
|
|
||||||
|
// 计算键盘位置(主窗口底部中央)
|
||||||
|
numeralKeyboard.Left = mainWindowLeft + (mainWindowWidth - numeralKeyboard.Width) / 2;
|
||||||
|
numeralKeyboard.Top = mainWindowTop + mainWindowHeight/2;
|
||||||
|
}
|
||||||
|
// 键盘按键事件处理
|
||||||
|
private void NumeralKeyboard_KeyPressed(object sender, TouchKeyboardNumeral.KeyPressedEventArgs e)
|
||||||
|
{
|
||||||
|
if (String.IsNullOrEmpty(e.KeyValue)) return;
|
||||||
|
|
||||||
|
switch (e.KeyType)
|
||||||
|
{
|
||||||
|
case KeyType.Character:
|
||||||
|
currentTextBox.Text += e.KeyValue;
|
||||||
|
break;
|
||||||
|
case KeyType.Backspace:
|
||||||
|
if (currentTextBox.Text.Length > 0)
|
||||||
|
{
|
||||||
|
currentTextBox.Text = currentTextBox.Text.Substring(0, currentTextBox.Text.Length - 1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case KeyType.Enter:
|
||||||
|
// 回车键处理
|
||||||
|
currentTextBox.Text = e.KeyValue;
|
||||||
|
break;
|
||||||
|
case KeyType.Hide:
|
||||||
|
// 隐藏键盘处理
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移动光标到文本末尾
|
||||||
|
currentTextBox.CaretIndex = currentTextBox.Text.Length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user