Good morning. I've got an interop .NET form that I can create and show inside a VB6 project. Now, I would like to open the form in "MDI mode". I've got a control that allows me to achieve this result. Unfortunatly it seems to work only with standard VB6 forms. So, the test I would like to try is to copy the content of the .NET form inside the VB6 one... Do you have any suggestion on how to deal with this situation?
Thank you!
The way you are doing this is asking for trouble - it's a bit hacky. It would be better to use supported mechanisms as far as possible.
You would be better off if you create a .NET UserControl with the GUI you want to display, and make it COM visible. You then can instantiate the control in a VB6 form, which would fully support the way that MDI is supported in VB6.
Related
I have a project that I have converted from VB6 to .NET, using Visual Studio 2008 with the framework 2.0. In VB6 you can call a PopupMenu like so:
Call Me.PopupMenu(mnuEstimating)
I tired to use the same code in .NET but I get the error:
'PopupMenu' is not a member of 'frmEstimatePriority'.
I have looked around on the web and have seen ContextMenuStrip being used in place of this. I would like not to have to add another/new object to the form designer if I don't have to. Is there another easier option besides ContextMenuStrip?
Can someone please tell me how to open a PopupMenu in VB.NET?
Assuming the form has a ContextMenuStrip control with menu items, try:
Me.ContextMenuStrip.Show(MousePosition)
I have a Migrated Project which contains PictureBox Events.When it is migrated to VB.NET 2008 some events are converted which are not correct.Because the PictureBox in VB.NET is different to VB6 PictureBox.I want to know one thing that can we use the Same picture box in VB.NET also.I think which may help us to use the same events.Can we do like this ? It contains some events like Picture_paint,AutoRedraw,setPoint etc.It has some Twips and Pixel Calculation also.
Will this help ?Do we have any upgraded control in .NET equivalent to Picture box of VB6?
This is not the right way to accomplish your goal. Try to upgrade to the new PictureBox in VB.Net.
Yes, they are different, but, you can hardly say that the VB.Net version is less capable than the VB6 version.
If you upgrade, do it fully and you will not regret the decision in the future.
This MSDN link exposes the difference between the two controls
Converting from VB6 to VB.Net is not easy process almost all your events will not work you need to find equivalent events in vb.Net
Go with this link
As already mentioned the controls in VB6 and VB.NET work differently so upgrading line for line is not really possible.
As a hlaf way house you could create an ActiveX Control (OCX) in VB6 containing your picturebox which raised the events required to the application and then use this in VB.NET
This tutorial may help you to get started
What is the quickest way to add a COM visible event to VB.NET class?
Is there something in the Visual Studio toolbox or is there a macro that will do this?
I am using VS2005.
EDIT: In this article http://msdn.microsoft.com/en-us/library/dd8bf0x3(v=vs.80).aspx, a GuidAttribute is specified. Is this generated by the programmer at design time, or does it need it to to match a GUID elsewhere?
I have created a VB.NET Class Library that exposes some COM Interop sub routines. These in turn show various forms that are contained within the Class Library. When the forms are shown from VB6 they do not inherit the visual styles of the operating system and act like VB6 controls.
I gather that this probably by design but is there some way to force/control visual styles manually in the .NET assembly? I would imagine that if I use a manifest in my VB6 app then everything will use the correct style but I would like to be able to control this myself if possible because we are using 3rd party controls in VB6 that do not require a manifest.
I think the manifest is the way to do it, but first, you could always try this:
Add a reference to Windows.Forms and call these two methods in your assembly entry point:
System.Windows.Forms.Application.EnableVisualStyles()
System.Windows.Forms.Application.DoEvents()
Note: We call DoEvents() because there was framework bug which caused errors and badly drawn styles. I believe this has been fixed since, but just in case.
I have a user control in vb.net application.
and i have a form in vb 6.
so in my vb.net applciation to this user control i need to mention the vb 6 form as its parent.
Means when i run a vb6 application i should see this user control as a part of that form.
Ahy help appreciated.
Take a look at the COM interop Toolkit.
It allows you to easily create com-visible .NET usercontrols, which can be used in VB6 for instance.
You can try saving it as a dom object in .net
After this, you can open it in vb6 in the menu components.
I've done it with guid class of .net but i donĀ“t know what you and to do, but i think you should try it.
It is actually fairly easy to add some plumbing to a VB.NET User control to expose it via COM as an ActiveX control that can be used by VB6 and other COM clients.
Here is an article describing how to do that:
"Writing an ActiveX Control in VB.NET"