瀏覽代碼

mxg:修改A2的输入方式

mengxiangge 5 年之前
父節點
當前提交
276a4e402a
共有 3 個文件被更改,包括 30 次插入2 次删除
  1. 27 0
      MBI/WPG/UserControls/TextBox_Double.cs
  2. 2 2
      MBI/WPG/UserControls/Textbox_DoubleUnit_A2.xaml
  3. 1 0
      MBI/WPG/WPG.csproj

+ 27 - 0
MBI/WPG/UserControls/TextBox_Double.cs

@@ -0,0 +1,27 @@
+/* ==============================================================================
+ * 功能描述:浮点型文本框
+ * 创 建 者:Garrett
+ * 创建日期:2018/3/7 15:26:49
+ * ==============================================================================*/
+
+using System.Windows;
+using System.Windows.Input;
+
+namespace WPG.UserControls
+{
+    /// <summary>
+    /// UnitTextBox__PlusDouble
+    /// </summary>
+    public class TextBox_Double : TextBox_InputLimit
+    {
+        static TextBox_Double()
+        {
+            InputMethod.IsInputMethodEnabledProperty.OverrideMetadata(typeof(TextBox_Double), new FrameworkPropertyMetadata(false));
+        }
+        public TextBox_Double():base()
+        {
+            TextControl=new AccessDecimal();
+        }
+
+    }
+}

+ 2 - 2
MBI/WPG/UserControls/Textbox_DoubleUnit_A2.xaml

@@ -14,12 +14,12 @@
                     <ColumnDefinition Width="*"/>
                     <ColumnDefinition Width="Auto"/>
                 </Grid.ColumnDefinitions>
-                <my:TextBox_PlusDouble Grid.Column="0" Grid.ColumnSpan="1"
+                <my:TextBox_Double Grid.Column="0" Grid.ColumnSpan="1"
                                           VerticalContentAlignment="Center"
                                           BorderBrush="{x:Null}" BorderThickness="0"
                                           Text="{Binding Path=Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}"
                                        IsReadOnly="{Binding Path=IsReadOnly}" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyGrid}, ResourceId=TextBoxStyle}}">
-                </my:TextBox_PlusDouble>
+                </my:TextBox_Double>
                 <Label Grid.Column="1" Padding="0"
                        VerticalContentAlignment="Center"
                        Content="{Binding Path=TextUnit,Mode=TwoWay, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}"></Label>

+ 1 - 0
MBI/WPG/WPG.csproj

@@ -427,6 +427,7 @@
       <DependentUpon>DataTime_Date_C5.xaml</DependentUpon>
     </Compile>
     <Compile Include="UserControls\ITextInputControl.cs" />
+    <Compile Include="UserControls\TextBox_Double.cs" />
     <Compile Include="UserControls\UcHyperlink.xaml.cs">
       <DependentUpon>UcHyperlink.xaml</DependentUpon>
     </Compile>