VB6 picture box on vb.net form

epic69

Newcomer
Joined
Apr 7, 2004
Messages
6
I need to put a Picture Box control from VB6 onto a VB.net form. I right click the toolbar in VB.net and click add/remove and then select com components. But no where in that list of com components do i see a picture box. Image, text box, list box, etc.. etc.... No picture box. How do i do that?
 
Why would you need the picture box from VB6? there is one for .NET. Also I am sure you can't bring over VB6 components to the .NET.
 
I need a VB6 picture box control, because the .net application is calling a .dll file that takes a picturebox object as an arguement, and the .dll is a VB6 .dll file. also you can take all kinds of VB6 controls and use them in .net, .net can use com components easily. I just cant find the picturebox control, i can find many others but not picturebox.
 
VB6 will not be supported by the next version of Windows*, so you really should avoid using anything to do with it!


*as of year old information, i presume it hasnt changed.
 
Do you have a source for that quote?

Unfortunately not, as i said before, i read it about a year, 18 month ago.

As a guess I would say it was more of a case of, you will need to download the VB6 framework and install it - just like you did with .NET when it first came out. Alternatively it may have something to do with the API's (guess again).

Edit: Spelling
 
VB6 will not be supported by the next version of Windows

Why and how would microsoft stop applications written in VB6 from working on the next version of windows?

I think maybe u mean that Microsoft are going to stop supporting VB6 - in terms of, no longer creating bug fixes or offering technical support, and this will occur by the time the next version of windows is released. I cant see why they would even bother 'blocking' the use of apps that have been written in VB6, it would be illogical, and only see them in court again!
 
Hey thats just what i read, as i say i cant remember the source.

I dont think it would be been a case of blocking it, more of a case of not providing something that VB6 needs as a matter of default.
For example changing the APIs would render 90% of VB programs useless (ok this would also render most other programs useless as well, but its an example!).
 
MS won't make a version of Windows that doesn't support VB6 for a very long time. As for the API calls, most of the common ones will be supported even though there may be newer alternatives. I would say that most applications written in VB6 have a VERY small percentage of code that relies on an API. API calls to set tabs in listboxes, get domain names, etc. will surely be supported for a long time.

MS's "mainstream support" for VB6 ends on March 1, 2005 - less than a month. I'm just now having to go back and give estimates and fix some code I wrote in VB6 almost 6 years ago. The company that now owns the application we wrote LOVES the application, sells it and has no plans to upgrade to .NET in the forseeable future. It's one of many large, stable, easy-to-maintain apps written in VB6. Why am I saying this? My point is that MS may stop mainstream support for VB6, but it's still in use and will be for a long time.

-ner
 
Hmm, most of my VB6 code was API, I guess that is a bad thing? I really didn't know of any other way to add icons to menu items without subclassing everything, or when working with bitmaps or metafiles, lots of good api for that... Also enumerating windows... Must just be me :(
 
Nothing wrong with windows apis... do the vb6 and .net runtimes, mfc, as well as most programs not eventually come down to windows apis (not an assertion, i honestly dont know)?
 
LOL, I can still run VB 3 applications on win 2 k 3 server. And vb3 was from before win95 -> over 10 years old.

So they might not support the development environment, but the run-time will still be working.
 
Just to add to this off-topic argument:

You can still run QBASIC on XP! and that's REALLY old.

Ok. now to add my question:
You still havn't really explained why you can't just use the .net picturebox.
 
thenerd said:
Ok. now to add my question:
You still havn't really explained why you can't just use the .net picturebox.
I really don't think that the COM Interop is going to convert a .Net Windows.Forms.PictureBox into a VB6 PictureBox. The Interop has backward-compatibility in mind, but I really don't think it will go that far.

It's unusual to have a function or sub of any sort that takes a PictureBox as an input though, and in this case, unfortunate. Epic, I think you might have to create a wrapper function using VB6 that can take, say, a Bitmap, which is then placed onto a VB6 PictureBox and then passed into the routine you are interested in. Your new COM wrapper would then expose a Bitmap as it's input.

I don't know a thing about graphics in .Net, not even really how to manipulate a Bitmap (sad, I know :(), but i would think that a .Net Bitmap could be passed to COM, but I'd have to leave this step to someone else to figure out...
 
If the reason is because of a function that needs to take the picturebox as input: What parts of it do you need? Why not just put in the parts of the picturebox seperately?

Visual Basic:
private function thing(image as bitmap, x as integer, y as integer, otherstuff as somethingelse, otherstuff as anotherthing) as boolean

?
 
Back
Top