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!
 

Rita Vanz

Member
Joined
Sep 3, 2019
Messages
5
Programming Experience
Beginner
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!
 

Herman

Well-known member
Joined
Oct 18, 2011
Messages
882
Location
Montreal, QC, CA
Programming Experience
10+
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...
 

Rita Vanz

Member
Joined
Sep 3, 2019
Messages
5
Programming Experience
Beginner
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!
 

Herman

Well-known member
Joined
Oct 18, 2011
Messages
882
Location
Montreal, QC, CA
Programming Experience
10+
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.
 

Rita Vanz

Member
Joined
Sep 3, 2019
Messages
5
Programming Experience
Beginner
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?
 

Herman

Well-known member
Joined
Oct 18, 2011
Messages
882
Location
Montreal, QC, CA
Programming Experience
10+
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.
 

Rita Vanz

Member
Joined
Sep 3, 2019
Messages
5
Programming Experience
Beginner
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!!!
 
Top Bottom