使用GetDlgItem进入循环 [英] Using GetDlgItem into a loop

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

问题描述

大家好,

我有一个包含将近50个项目的表单(按钮,标签,编辑...).我正在寻找使我能够使用循环对这些物品采取行动的功能

Hi All,

I have a Form with almost 50 Items ( buttons, labels, Edit ...). I m looking for sth that give me the ability to act on those items by using a loop

for (i =0; i< COUNT; i++)
{
   GetDlgItem( ITEM i );
}



thx



thx

推荐答案

如果您的表单是CFormView派生的类,则可以使用CWnd::GetNextDlgTabItem()CWnd::GetNextDlgGroupItem().
If your form is a CFormView derived class, you may use CWnd::GetNextDlgTabItem() and CWnd::GetNextDlgGroupItem().


为什么不使用 EnumChildWindows [ ^ ]函数?

Why don''t you use the EnumChildWindows[^] function?

Schehaider_Aymen写道:
Schehaider_Aymen wrote:

我什至不知道如何使用该功能!

I don''t even know how to use that function !

[update]
好吧,毕竟您有文档.
粗略地说,您调用EnumChildWindows传递了ythedialog的句柄和函数指针.然后Windows将多次调用您的函数,每次传递不同对话框的子窗口的句柄.
[/update]

[update]
Well, you have the documentation, after all.
Roughly speaking you call EnumChildWindows passing a the handle of ythedialog and a function pointer. Then Windows will call your function many times, each time passing the handle of a different dialog''s child window.
[/update]


这篇关于使用GetDlgItem进入循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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