功能 [英] functions

查看:57
本文介绍了功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我想知道是否有一个函数在我的程序的

运行时期间一直运行以及我可以在哪里放置事件

重载和运行期间我需要检查的东西(如果有一个标签

页面被按下了)?

谢谢!


***通过开发人员指南 http://www.developersdex.com ***

不要只参加USENET ......获得奖励!

Hello,
I would like to know if there is a function which is running during the
runtime of my program all the time and where I could place events
overloading and things I need to check during the run(Like if some tab
page been pressed )?
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!

推荐答案

要了解这些事情,您必须为您的控件提供的各种活动添加处理程序

。当用户与界面交互

时,这些调用代码。


要检测标签页的使用,你会得到

TabControl.SelectedIndexChanged事件。


-

Bob Powell [MVP]

Visual C#,System。绘图


在Windows窗体中查找优秀的Windows窗体提示和技巧
http://www.bobpowell.net/tipstricks.htm

用GDI + FAQ回答那些GDI +问题
< a rel =nofollowhref =http://www.bobpowell.net/faqmain.htmtarget =_ blank> http://www.bobpowell.net/faqmain.htm


所有新文章都提供C#和VB.NET代码。

订阅所提供的RSS提要,绝不会错过任何新文章。


juli jul <菊****** @ yahoo.com>在消息中写道

news:uo ************** @ TK2MSFTNGP12.phx.gbl ...
To be informed of such things you must add handlers to the various events
provided by your controls. These call into your code when the user interacts
with the interface.

To detect the use of a tab page you''ll get the
TabControl.SelectedIndexChanged event.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"juli jul" <ju******@yahoo.com> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
你好,我想知道是否有一个函数在我的程序运行期间一直运行,我可以在哪里放置事件
重载和运行期间需要检查的东西(如果一些标签页面被按下了?
谢谢!

***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励!
Hello,
I would like to know if there is a function which is running during the
runtime of my program all the time and where I could place events
overloading and things I need to check during the run(Like if some tab
page been pressed )?
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


10xs但确切地说 - 我应该将这些事件放在哪个函数?

哪个函数将继续运行并在所有
$期间检查输入b $ b运行?


***通过开发人员指南 http发送://www.developersdex.com ***

不要只是参与在USENET ...获得奖励!
10xs but where exactly - which function I should place those events?
Which function will continuesly run and check for inputs during all the
run?

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


您需要阅读更多关于事件和表格的信息。你问的方式

这个问题告诉我你有一些基本的误解

关于表单应用程序如何运行。


那里有_is no_功能这将持续运行并在应用程序运行时检查

输入。这不是它的工作原理

所有。


简而言之,它的工作方式是你_subscribe_来自的活动
$来自表单各个部分的b $ b。例如,您提到了一个标签页。

您可以订阅标签页'''VisibilityChanged"事件。这个

的意思是_标签页将调用你的函数_每当它显示为不显示时为
,反之亦然。那里_is no_主人

功能观看放置代码的标签页。 _你有
写一个函数做某事然后告诉标签页,只要你的能见度发生变化,就打电话给



正如我所说,你必须阅读表格和事件,以及他们如何工作。在这里详细解释这个话题太大了。

You need to read up more on events and forms. The way you''ve phrased
the question tells me that you have some fundamental misunderstandings
about how forms applications run.

There _is no_ "function" that will "continuously run" and check for
inputs while your application is running. That''s not how it works at
all.

In brief, the way it works is that you _subscribe_ to events coming
from various parts of your form. For example, you mentioned a tab page.
You can subscribe to a tab page''s "VisibilityChanged" event. What this
means is that _the tab page will call your function_ whenever it goes
from showing to not showing, or vice versa. There _is no_ "master
function" watching the tab page in which you place your code. _You have
to write_ a function to do something and then tell the tab page, "Call
this whenever your visibility changes."

As I said, you have to do some reading on forms and events and how they
work. It''s too big a topic to explain here in sufficient detail.


这篇关于功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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