取消/停止文本框显示 [英] cancel/stop textbox display

查看:65
本文介绍了取消/停止文本框显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的;

我开发了一个C#代码,并从串行端口读取数据并将其显示在文本框中;

I develop a C# code and read data from serial port and display it in a textbox;

当我接收重复数据时,我想停止显示.并在收到另一个数据显示时再次开始.

I want to stop display if when I recive repetitive data. and when receive another data display start again.

你能帮我吗?

可以吗?

推荐答案

我将使用观察者模式,其中当接收到新的(另一个)数据时,正在侦听串行端口的代码会引发一个事件.事件处理程序会将新数据附加到文本框中.

I would use the observer pattern where the code that is listening to the serial port raises an event when new (another) data is received. The eventhandler would append the new data to the textbox.

亲切的问候,
汤姆·德·科宁(Tom de Koning)

Kind regards,
Tom de Koning


这篇关于取消/停止文本框显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆