令人耳目一新的主要形式 [英] refreshing main form

查看:120
本文介绍了令人耳目一新的主要形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类(主窗体类除外),可以在其中读取数据文件.此调用是从各个角度进行的(不必从主要形式进行).
读取数据后,我想将其显示在主窗体的面板上.如何从数据读取类中调用主窗体的OnPaint以便显示它?

I have a class (other than main form class) where in I read a data file. This call is made from various points (need not be from main form).
After reading the data, I want to display it on the panel on the main form. How can I call OnPaint of main form from data reading class in order to display it?

推荐答案

您不应该调用该窗体背部.如果数据类有事件可以在更改时引发,则无论引用哪个类,数据更改时也可以刷新自身.
You shouldn''t call the form back. If the data class has an event it can raise when it changes, whichever class is referencing it can also refresh itself when the data is changed.


这篇关于令人耳目一新的主要形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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