如何从VB6捕获VB.NET事件? [英] How to capture VB.NET Event From VB6????

查看:68
本文介绍了如何从VB6捕获VB.NET事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用VB.NET开发的类库。里面有一个带有

按钮1的表单。


我将这个类库添加到VB6项目中。


我做了一个

Dim a as new classlibrary.form1

SetParent a.GetHwnd,Me.hWnd

a.show


但现在我有一个问题,如果用户点击

ClassLibrary中的Button1,我希望我的VB6知道button1正在点击。

这是因为当点击button1时,vb6需要做一些处理。


任何人都知道怎么做?


问候

Vanessa

解决方案

我有一个用VB.NET开发的类库。里面有一个带
的表格


button1。


我将这个类库添加到VB6项目中。


我做了一个

昏暗的新的classlibrary.form1

SetParent a.GetHwnd,Me.hWnd

a.show


但现在我有一个问题,如果用户点击

ClassLibrary中的Button1,我希望我的VB6知道button1正在点击。

这是因为当点击button1时,vb6需要做一些处理。


任何人都知道怎么做?



也许可以将它转换为VB6,从而消除70多万MB

的依赖关系,同时使其工作?是什么原因

可能会用VB.Net代码来鞍VB?




" mayayana" < ma ********** @ mindXXspring.com写了留言

新闻:X5 ****************** @ newsread1 .news.pas.earth link.net ...


我有一个用VB.NET开发的类库。里面有一个
的表格



a


button1。


我将这个类库添加到VB6项目中。


我做了一个

Dim a as new classlibrary.form1

SetParent a.GetHwnd,Me.hWnd

a.show


但现在我有一个问题,如果用户点击

ClassLibrary中的Button1,我希望我的VB6知道button1正在点击。

这是因为当点击button1时,vb6需要做一些处理。


任何人都知道怎么做?



也许可以将它转换为VB6,从而消除70多个MB

的依赖关系,同时使其工作?是什么原因

可能会用VB.Net代码来鞍VB?






将它全部转换为VB.NET,而不是打扰VB6位。这一切都取决于你能得到最多的东西。如果你有一个现有的VB6应用程序,那么是否有令人信服的理由与VB.NET互操作,或者你也不能在VB6中编写这个

组件。


OTH如果你现有的VB.NET代码为什么要创建一个VB6应用程序呢?
它为什么不继续使用VB.NET for UI元素也是如此。


然而要回答原来的问题: -

http://www.codeproject.com/dotnet/cominterop.asp


< blockquote>" Anthony Jones" < An*@yadayadayada.com写信息

新闻:%2 **************** @ TK2MSFTNGP04.phx.gbl ...


>

,为什么不继续使用VB.NET作为UI元素。



也许它不是一个网络应用......或者他想要比网络更好。表演...我

dunno。


-

Ken Halter - MS-MVP-VB - 请保留所有讨论在小组中..

在爱的记忆中 - http:/ /www.vbsight.com/Remembrance.htm


I have a class library developed in VB.NET. Inside there is a form with a
button1.

I add this class library to a VB6 Project.

I do a
Dim a as new classlibrary.form1
SetParent a.GetHwnd, Me.hWnd
a.show

But now I have a question, if the user click on the Button1 in the
ClassLibrary, I want my VB6 to know that button1 is being click.
This is becase when button1 is clicked, vb6 needs to do some processing.

Anyone know how to do this?

Regards
Vanessa

解决方案

I have a class library developed in VB.NET. Inside there is a form with a

button1.

I add this class library to a VB6 Project.

I do a
Dim a as new classlibrary.form1
SetParent a.GetHwnd, Me.hWnd
a.show

But now I have a question, if the user click on the Button1 in the
ClassLibrary, I want my VB6 to know that button1 is being click.
This is becase when button1 is clicked, vb6 needs to do some processing.

Anyone know how to do this?

Maybe translate it to VB6 and thereby eliminate 70+ MB
of dependencies while also making it work? What reason
could there possibly be to saddle VB with VB.Net code?



"mayayana" <ma**********@mindXXspring.comwrote in message
news:X5******************@newsread1.news.pas.earth link.net...

I have a class library developed in VB.NET. Inside there is a form with

a

button1.

I add this class library to a VB6 Project.

I do a
Dim a as new classlibrary.form1
SetParent a.GetHwnd, Me.hWnd
a.show

But now I have a question, if the user click on the Button1 in the
ClassLibrary, I want my VB6 to know that button1 is being click.
This is becase when button1 is clicked, vb6 needs to do some processing.

Anyone know how to do this?

Maybe translate it to VB6 and thereby eliminate 70+ MB
of dependencies while also making it work? What reason
could there possibly be to saddle VB with VB.Net code?

OR

convert it all to VB.NET and not bother with the VB6 bit. It all depends on
what you''ve got the most of. If you have an existing VB6 app then is there
a compelling reason to interop with VB.NET or can''t you just write this
component in VB6 as well.

OTH if you existing VB.NET code why would you want to create a VB6 app round
it, why not just continue with VB.NET for the UI element as well.

However to answer the original Q:-

http://www.codeproject.com/dotnet/cominterop.asp


"Anthony Jones" <An*@yadayadayada.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...

>
it, why not just continue with VB.NET for the UI element as well.

Maybe it''s not a web app.... or he wants "better than web" performance... I
dunno.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm


这篇关于如何从VB6捕获VB.NET事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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