Can We use the VB6 PictureBox in VB.NET? - vb.net

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

Related

Reparent controls from a .NET form to VB6

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.

fix form size in visual studio

I am trying to design a web form in visual basic and i have a problem.I put all the elements(buttons, labels etc) in the place i want.When i run the form i have the option to maximize the screen of the form and when i do this,a blank space appears in the form where there are no elements and all my elements are shown to the left upper side of the form. I can't see that blank space when i am designing the form. Could you help me how to fix the fix the size?
I tried autosize,autoscroll and size properties but i didn't fix the problem.
You don't specify whether it's VB6 or VB.Net but for once, it doesn't matter much.
Look at the form property BorderStyle, and change it to one of the "fixed" options.
VB6 documentation
VB.Net documentation

vb3DShadow & vb3DHighlight in vb.net2008

Am trying to create a 3d line control using lineshape control in vb2008, and i need these two color format vb3DShadow & vb3DHighlight, but can't seem to find it in .net. I originally used it in vb6.
i got the line shape control from visualbasicpowerpacks.
can someone help me with these colors version in vb.net or help me draw the control in another way using the graphics class of vb.net 2008
I found the replacement
System.Drawing.SystemColors.ControlLightLight
System.Drawing.SystemColors.ControlDark
thanks for those who participated

Shapes control in vb.net

Is there anything like shapes control of VB 6.0, in Vb.Net?
I need to draw lines etc. at design time. But I could not find any shapes control in the toolbox.
Thanks
Furqan
Microsoft released the free Microsoft Visual Basic Power Pack that contains Line and Shape controls that you can add to the tool box. A post here suggests it is included in VS2008 SP1 so you may already have it.
Alternatively you can create your own using a panel and override the onPaint event.
no built in controls but you can easily achieve the same goal with some API calls: http://msdn.microsoft.com/en-us/library/bbw12xs4(v=VS.90).aspx

Loading a Vb.net control inside a VB 6 form

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"