在Matlab中完成代码绘制后,如何使表格重新聚焦? [英] How to bring the form back to focus after the code finish ploting in matlab?

查看:110
本文介绍了在Matlab中完成代码绘制后,如何使表格重新聚焦?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,我的代码使用Matlab作为COM服务器,并让matlab在图形中绘制一些数据,该图形通常在名为图1"的新窗口中打开.完成绘制后,我希望将注意力集中在调用执行matlab命令的子窗体的表单上.我尝试在子调用后添加两行

Hi folks, my code uses Matlab as a COM server and has matlab plot some data in a figure, which is opened up in a new window named ''Figure 1'' normally. After it''s done plotting I hope to give focus back to the form that calls the sub that execute the matlab commands. I''ve tried to add two lines after the sub call

PassDataNPlot()
Me.BringToFront()
Me.Focus()


但是完成后,绘制matlab图仍然在我的窗体上.我不知道还有什么办法可以解决?有任何建议吗?


but when it''s done plotting the matlab figure is still on top of my form. I wonder what else could do the trick? any suggestions?

推荐答案

创建具有以下形式的对象,并将Show()方法与该对象一起使用.

例如:
create an object of the form and use the Show() method with the object.

eg:
frmNew obj=new frmNew();
obj.show();


这篇关于在Matlab中完成代码绘制后,如何使表格重新聚焦?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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