高中生
最后登录1970-1-1
在线时间 小时
注册时间2018-8-23
|
发表于 2018-11-5 21:43:09
|
显示全部楼层
有个上位机里面的UDP源码写错了吧,就是网络测试那一块,上位机接收的控件应该是TextBox,源码里面写的是Image;原代码如下:
[mw_shl_code=csharp,true]<!--接收文本窗口-->
<ScrollViewer x:Name="receiveScrollViewer" Grid.Column="1" HorizontalAlignment="Stretch" Margin="5,5,5,5" Grid.Row="0" VerticalAlignment="Stretch" >
<TextBox x:Name="receiveTextBox" Foreground="White" Background="Black" IsReadOnly="True" TextChanged="ReceiveTextBox_TextChanged" TextWrapping="Wrap" TextAlignment="Left" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontFamily="宋体" FontSize="15" >
</TextBox>
<ScrollViewer.ToolTip>
<ToolTip Placement="Top" Content="显示串口接收到的数据" >
</ToolTip>
</ScrollViewer.ToolTip>
</ScrollViewer>
<ScrollViewer x:Name="picScrollViewer" Grid.Column="1" HorizontalAlignment="Stretch" Margin="5,5,5,5" Grid.Row="0" VerticalAlignment="Stretch" >
<Image x:Name="picImage" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
</Image>
<!--<ScrollViewer.ToolTip>
<ToolTip Placement="Top" Content="显示串口接收到的数据" >
</ToolTip>
</ScrollViewer.ToolTip>-->
</ScrollViewer>
<!--发送文本窗口-->
<ScrollViewer Grid.Column="1" HorizontalAlignment="Stretch" Margin="5,5,5,5" Grid.Row="1" VerticalAlignment="Stretch">
<TextBox x:Name="sendTextBox" Foreground="White" Background="Black" PreviewTextInput="SendTextBox_PreviewTextInput" AcceptsReturn="True" TextWrapping="Wrap" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontFamily="宋体" FontSize="15">
</TextBox>
<ScrollViewer.ToolTip>
<ToolTip Placement="Top" Content=" 将要发送的数据,Ctrl+Enter发送">
</ToolTip>
</ScrollViewer.ToolTip>
</ScrollViewer>[/mw_shl_code] |
|