gpt4 book ai didi

c# - 使用 Xceed.Wpf.Toolkit 中的 MaskedTextBox 时出现 SetConnectionId 异常

转载 作者:太空宇宙 更新时间:2023-11-03 21:24:26 26 4
gpt4 key购买 nike

我将为我的 wpf 项目使用 MaskedTextbox,这样我就可以拥有一个带有 Mask 的文本框。我对如何使用它完全陌生。说明是下载扩展的 wpf 工具包,将其引用到您的项目中,它将起作用。

所以当我构建项目时,没有显示任何错误。但是,当我尝试转到有屏蔽文本框的表单时,发现错误“Set connectionId throw an exception”。希望有人知道解决方案。我试着像我看到的一些帖子一样重建它,但仍然无济于事。我的 xaml 代码是:

 <Page x:Class="Kiosk_Lobby_System.Transaction.Deposit.CashDeposit"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wpftool="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="790"
Title="CashDeposit" Loaded="Page_Loaded" >

<Grid>
<Grid Margin="10,10,-10,-10">
<Frame Name="frame1" HorizontalAlignment="Right" Width="329" Margin="0,0,0,-16">
<Frame.Content>
<Grid Margin="0 90 0 0" HorizontalAlignment="Right" Width="339" Height="508">
<WrapPanel ItemHeight="73" ItemWidth="83" Height="385" Width="255" HorizontalAlignment="Center" Name="wrapPanel1" VerticalAlignment="Center" Margin="0,9,-20,114">
<Button Style="{StaticResource ResourceKey=keybutton}" Content="1" FontSize="26" Height="65" Name="button_numeric_1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="75" Click="button_numeric_1_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="2" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_2" VerticalAlignment="Top" Width="75" Click="button_numeric_2_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="3" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_3" VerticalAlignment="Top" Width="75" Click="button_numeric_3_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="4" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_4" VerticalAlignment="Top" Width="75" Click="button_numeric_4_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="5" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_5" VerticalAlignment="Top" Width="75" Click="button_numeric_5_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="6" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_6" VerticalAlignment="Top" Width="75" Click="button_numeric_6_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="7" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_7" VerticalAlignment="Top" Width="75" Click="button_numeric_7_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="8" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_8" VerticalAlignment="Top" Width="75" Click="button_numeric_8_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="9" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_9" VerticalAlignment="Top" Width="75" Click="button_numeric_9_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="." FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_dot" VerticalAlignment="Top" Width="75" OpacityMask="{x:Null}" Click="button_numeric_dot_Click" FontFamily="Arial"></Button>
<Button Style="{StaticResource ResourceKey=keybutton}" Content="0" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_0" VerticalAlignment="Top" Width="75" OpacityMask="{x:Null}" Foreground="Black" Click="button_numeric_0_Click" FontFamily="Arial" />
<Button Style="{StaticResource ResourceKey=keybutton}" Content="Del" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_delete" VerticalAlignment="Top" Width="75" Click="button_numeric_delete_Click" FontFamily="Arial" />
</WrapPanel>
<WrapPanel Height="72" Width="255" HorizontalAlignment="Center" Name="wrapPanel2" VerticalAlignment="Center" Margin="0,298,-20,138">
<Button Style="{StaticResource ResourceKey=keybutton}" Content="Clear All" FontSize="26" Height="65" HorizontalAlignment="Left" Name="button_numeric_clear" VerticalAlignment="Top" Width="241" OpacityMask="{x:Null}" Click="button_numeric_clear_Click" FontFamily="Arial"></Button>
</WrapPanel>
</Grid>
</Frame.Content>
</Frame>
<Frame HorizontalAlignment="Left" Name="frame2" Width="454" Margin="43,-28,0,12">

<Frame.Content>
<GroupBox Name="groupBox1" Width="416" Height="405" Margin="0 85 0 0" IsEnabled="True" HorizontalAlignment="Right">
<Grid Margin="0 -40 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="413" Height="367" >
<Label Style="{StaticResource label}" Content="Account Number:"
FontSize="22" FontWeight="Bold" Height="45"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
Margin="56,70,6,0" Name="lblAcccountNumber"
VerticalAlignment="Top" VerticalContentAlignment="Center" />
<wpftool:MaskedTextBox FontSize="22" Height="47" HorizontalAlignment="Center"
HorizontalContentAlignment="Right" IsEnabled="True" Margin="0,117,0,0"
Name="txtAccountNo" PreviewTextInput="number" VerticalAlignment="Top"
VerticalContentAlignment="Center" Width="300" PreviewMouseLeftButtonDown="txtAccountNo_PreviewMouseLeftButtonDown" PreviewKeyDown="txtPreviewKeyDown" PreviewMouseLeftButtonUp="txtAccountNo_PreviewMouseLeftButtonUp"
Mask="_ _ _- _ _ _ - _ _ _ _ _ - _"/>
<!--<TextBox AcceptsReturn="True" FontSize="22" Height="47" HorizontalAlignment="Center"
HorizontalContentAlignment="Right" IsEnabled="True" Margin="0,117,0,0"
Name="txtAccountNo" PreviewTextInput="number" VerticalAlignment="Top"
VerticalContentAlignment="Center" Width="300" PreviewMouseLeftButtonDown="txtAccountNo_PreviewMouseLeftButtonDown" PreviewKeyDown="txtPreviewKeyDown" PreviewMouseLeftButtonUp="txtAccountNo_PreviewMouseLeftButtonUp" />-->
<Label Style="{StaticResource label}" Content="If PSBank prepaid, indicate the card number."
FontSize="12" Height="32"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
Margin="56,165,6,0" Name="lblAcccountNumberMessage"
VerticalAlignment="Top" VerticalContentAlignment="Center" />

<Label Style="{StaticResource label}" Content="Amount:" FontSize="22"
FontWeight="Bold" Height="45" HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left" Margin="56,200,5,0"
Name="lblAmount" VerticalAlignment="Top"
VerticalContentAlignment="Center" />

<TextBox AcceptsReturn="True" FontSize="22" Height="47" HorizontalAlignment="Center"
HorizontalContentAlignment="Right" IsEnabled="True" Margin="56,244,58,0"
Name="txtAmount" PreviewTextInput="number" VerticalAlignment="Top"
VerticalContentAlignment="Center" Width="300" PreviewMouseLeftButtonDown="txtAmount_PreviewMouseLeftButtonDown"
PreviewKeyDown="txtPreviewKeyDown" IsReadOnly="False" PreviewMouseLeftButtonUp="txtAmount_PreviewMouseLeftButtonUp" LostFocus="txtAmount_LostFocus" />

<Button Content="OK" FontSize="22" Height="45" HorizontalAlignment="Right"
Margin="0,0,62,-20" Name="btnCashDeposit_next" Style="{StaticResource button}"
VerticalAlignment="Bottom" Width="130" Click="btnCashDeposit_next_Click" />
<Button Content="Back" FontSize="22" Height="45" HorizontalAlignment="Left" Margin="58,0,0,-20"
Name="btnCashDeposit_cancel" Style="{StaticResource button}" VerticalAlignment="Bottom" Width="130" Click="btnCashDeposit_cancel_Click" />
</Grid>
</GroupBox>
</Frame.Content>
</Frame>
<Label Style="{StaticResource label2}" Content="Cash Deposit" FontSize="32"
FontWeight="Bold" Height="50" HorizontalAlignment="Center"
HorizontalContentAlignment="Center" Margin="-10,15,0,0" Name="labelTitle"
VerticalAlignment="Top" VerticalContentAlignment="Center" Width="800" />
</Grid>
</Grid>
</Page>

最佳答案

尝试以下步骤:

  1. 右键单击 Xceed.Wpf.Toolkit.dll -> 属性 -> 取消阻止

enter image description here

  1. 引用属性 -> 将“复制本地”设置为 True

enter image description here

关于c# - 使用 Xceed.Wpf.Toolkit 中的 MaskedTextBox 时出现 SetConnectionId 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28123562/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com