Question VB6 ocx property to VB.Net problem

Rita Vanz

Member
Joined
Sep 3, 2019
Messages
5
Programming Experience
Beginner
I have an OCX gauge control I used successfully in VB6 (prjGauge.ocx). This gauge has max and min properties that can be set by the user, like, "gauge1.max = 100". Since then I have moved to VB.Net and when I add the contol to a form it has no max and min properties. Or maybe I don't know how to access them. I get an error message saying max is not a property of gauge. Can anyone explain why? Thanks for any help!
 
It is possible interop generated separate accessor members for the properties, for example Let_Max and Get_Max.
 
It is possible interop generated separate accessor members for the properties, for example Let_Max and Get_Max.
I am not experienced enough to fully understand what you wrote about "accessor members" but I am intuitive enough to play around with Let_Max and Get_Max. Get_max was accepted but Let_Max wasn't. So I tried Set_Max and it worked! Thanks, you have helped me enormously. This had me stumped and I couldn't progress in my project. You are a gem!
 
Nice, today properties may have a Get/Set, in VB6 there was a Let also that in some cases was used instead of Set.
 
You shouldn't really be using VB6 user controls in .NET... There isn't even really a valid reason to still be using VB6 code at all, really... If all you want is a gauge, use a .NET gauge control, or pretty much any charting control you can find...
 
You shouldn't really be using VB6 user controls in .NET... There isn't even really a valid reason to still be using VB6 code at all, really... If all you want is a gauge, use a .NET gauge control, or pretty much any charting control you can find...
Herman you shouldn't really be telling me which controls I should be using in .NET!!! You sound like a troll. I am modelling the tuning circuits of vintage radios wich use vintage air variable capacitors. The prjGauge.ocx does this perfectly. Like the vintage capacitors it has a 180 degree sweep of the needle and displays the min and max values at each end. just below the pivot point of the needle it displays the current value of the needle. This gauge is the best gauge I have found to carry out this function. Of course you might know better, in which case what you should have done is point me to a better gauge. Think before you leap!
 
You are using a control written in a dead language for another dead language. It's not made to work with .NET and it does purely by chance. No need for the aggression.
 
Ok Herman, here are a couple of facts for you. Windows 10 registered prjGauge.ocx. Visual Studio 2019 added prjGauge.ocx to the .NET component list. That makes prjGauge.ocx a valid .NET component. Not a dead component, but a component currently supported in .NET. Who is right? You or .NET?
 
No, it's an OCX, ergo an ActiveX component, a now defunct technology Microsoft developed as client side components downloadable through Internet Explorer. Edge doesn't even support them anymore. I'm not debating if it's working or not, I am telling you you should be using a native .NET component instead of an old component from the VB6 era. The fact that the component still works in Windows 10 and .NET is pure chance. If you're happy with delivering crappy software, good for you. I am just trying to steer you in the right direction.

I have a feeling you're getting flustered because it's a component you developed way back when, somehow. How you feel about it doesn't change the fact that you are integrating outdated technology into a new project.
 
People come here with many problem and get many solutions. Which solution is the correct solution? Any one that works! Well I had a problem and now I don't thanks to JohnH (exept for the troll with the overblown ego). My gauge is working well inside .NET and my project is coming along just nice.

Herman is just a troll who likes to get his fingers into every pie! Well Herman I'm finished with you. You need to take a lesson on constructive help and stop wasting peoples time. The End!!!
 
I agree what Herman is saying, OCX is out dated and can be a Vulnerability to the .NET application and your windows 10, "Depending on its control methods", I also agree with Rita Vanz on the subject of using the control, it its accessible by .Net then yes feel free to use it, on another note I don't think Herman was trolling at all, he was just trying to help you in the correct direction but keeping with a more updated controls, Hope yous both have a great day, Just bare in mind "OCX" controls can be very unstable and crash the program or even windows it's self.


ProtekNickz xD
 
Back
Top