工具栏和mdi子表单 [英] Toolbar and mdi child forms
本文介绍了工具栏和mdi子表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个MDI Parent表单,其工具栏上有一个Next和Previous按钮
。
我打开一个MDI Child表单,有两个例程,叫做nextrec和
prevrec。
当我点击父窗口的Next或Previous按钮时,我想要
相应的例程(nextrec / prevrec)在子表单上触发。
如何在VB.NET 2003中完成这个?
TIA。
Jamie。
I have a MDI Parent form with a toolbar that has a Next and Previous button
on it.
I open up a MDI Child form, that has two routines, called nextrec and
prevrec.
When I hit the Next or Previous button on the parent window, I want the
corresponding routine (nextrec/prevrec) on the child form to fire.
How is this done in VB.NET 2003 ???
TIA.
Jamie.
推荐答案
这假设nextrec和prevrec是公共方法
private void next_Click(object sender,EventArgs e)//Next的处理程序butto
((MyChildForm)ActiveMdiChild).nextrec()
private void prev_Click(对象发送者,EventArgs e)//处理程序Previous butto
((MyChildForm)ActiveMdiChild).prevrec()
This assumes that nextrec and prevrec are public methods
private void next_Click(object sender, EventArgs e) // handler for "Next" butto
((MyChildForm)ActiveMdiChild).nextrec()
private void prev_Click(object sender, EventArgs e) // handler for "Previous butto
((MyChildForm)ActiveMdiChild).prevrec()
这假设nextrec和prevrec是公共方法
private void next_Click(object sender,EventArgs e)//Next的处理程序butto
((MyChildForm)ActiveMdiChild).nextrec()
private void prev_Click(对象发送者,EventArgs e)//处理程序Previous butto
((MyChildForm)ActiveMdiChild).prevrec()
This assumes that nextrec and prevrec are public methods
private void next_Click(object sender, EventArgs e) // handler for "Next" butto
((MyChildForm)ActiveMdiChild).nextrec()
private void prev_Click(object sender, EventArgs e) // handler for "Previous butto
((MyChildForm)ActiveMdiChild).prevrec()
不幸的是,这在VB中不起作用。
如何从ActiveMdiChild创建对类型的引用
属性???,
而不是发出Dim myChildForm As会员
由于我有很多子表单,因此将每个表单
添加到prev / next按钮点击事件是没有意义的。
***通过开发人员指南发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励!
Unfortunately, this does not work in VB.
How do you create a reference to a type from the ActiveMdiChild
properties ???,
instead of issuing Dim myChildForm As members
Since I have many child forms, it does not make sense to add each form
to the prev/next button click events.
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!
这篇关于工具栏和mdi子表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文