使用GetDlgItem进入循环 [英] Using GetDlgItem into a loop
问题描述
大家好,
我有一个包含将近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 aCFormView
derived class, you may useCWnd::GetNextDlgTabItem()
andCWnd::GetNextDlgGroupItem()
.
为什么不使用 EnumChildWindows [ ^ ]函数?
Why don''t you use the EnumChildWindows[^] function?
我什至不知道如何使用该功能!
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屋!