tags:

views:

234

answers:

4

I'm looking for a replacement for the Sheridan 3D Panel (ssPanel) and I'm trying to figure out which of the Controls in the Projects>Components I can add to my project which will be supported by Microsoft. (I.e., I don't want to add a control that MS doesn't officially "support", like the MS Forms 2.0 Object Library).

Update Microsoft does still support VB6 (or at least the files that it uses)

A: 

A comment from MarkJ made me re-read the Q, and from "replacement" I now understand this is likely a re-code/new version project, not a start from scratch... the original answer below is not accouting for that. Meanwhile, MS says it's suportting a core runtime file of a language that has no roadmap or committed resources (?), so bottom-line of my answer still stands: vb6 stopped, new projects can go Python, vb.app, java, c++, C#, whatever.

Original: None. VB6.0 reached its End-Of-Life. Go Python! or Java, or C#... never vb .net, because it's tons harder/dense than Java, not VB6.0 syntax in the slightest, and the learning curve is just a notch under C#.

P.S. It's so interesting to have negative votes because I trashed vb .net when compared to java or c#. I wonder what these guys would think of me, being a former vb6 programmer, and not moving to any of the .net flavors.

jpinto3912
This must be one of most ridiculous comments about vb.net I've ever heard
Vnuk
Let me get this straight. You are saying not to use VB.NET because it is harder than Java. But you are also saying to use C# because it is harder than VB.NET?
Jonathan Allen
I up voted you because through the rushed answer your underlying point seems to be that learning C# or Java will be a better career move in the end. (I also love electronics.)
ChaosPandion
The underlying point is in fact that if you were vb6, you either want to move up to C#, because vb .net is no longer much lighter and simpler, or choose something else. I'd move out of .net entirely, try java if long term (10yrs) project is the goal, or go again to ligher and simpler, easy controls-app, python.Ending vb (MS "till win 7 support" talk is not relevant, the development stopped) was a necessity for MS, and I regret that because it got me a huge amount of daily problems solved, with development costs far lower than the alternatives pointed out. Has the countdown on vb.app started?
jpinto3912
With respect: You've got the negative votes because this is a question about maintaining VB6 code, and just saying "you must rewrite the whole application in Python/Java/C#" is IMHO extremely unlikely to be the best way forward. (In terms of giving the code owners the best return on their money - Clay's salary.)
MarkJ
MarkJ, I wasn't mind-framing a rewrite to java/C#/Python. I do see NOW (word "replacement" implies it) that the question is about a project rewrite (I misunderstood as someone beginning a new project). I agree with you, point taken, I would not give that answer if initially I understood "replacement"... I later commented again on the assumption Clay was starting from scratch.It's bad when your tool works well, gets obsolete and there's no easy replacement.
jpinto3912
Vnuk, really? than you haven't heard half the comments I have.
jpinto3912
Jonathan, not just harder, but denser, because one needs to know "by hart" a big part of the .net map. I'd agree that you also need to know your classes in Java, but it is a much smaller mind-mapping effort.Take my case: I don't use vb or java everyday. To birth some fast tooling once in every month, it's much more memory-intensive to code .net (c# or vb) than java.Regarding vb or c#... it's MS that says C# it's more powerfull, and that are much fewer coding differences than before, between vb 6/c++. I don't code C#, just C and used to C++. So, what's the vb .net use case?
jpinto3912
@jpinto3912 I have removed the -1. Although there are still committed resources for VB6. Here's an interview in September 09 with the lucky Microsoft guy who's in charge of VB6 support http://channel9.msdn.com/posts/funkyonex/What-is-Microsofts-Visual-Basic-6-Support-Strategy/
MarkJ
+1  A: 

What part of the SSPanel behaviour do you need?

  • If it's the custom appearances (raised 3D edge etc.) it's not too hard to write a user control based on the intrinsic VB6 Label and Line controls. Have a look at the edge of the SSPanel in the magnified screenshot below. It's just a one pixel border. The colours are system colours: left and top are "button highlight" &H80000014& and the right and bottom are "button shadow" &H80000010&. Put four line controls in a user control and write code in the resize event to move them to the edge of the control.

alt text

  • If you need a label that can act as a container, you could make your user control capable of being a container (set ControlContainer True).

  • Vertically centred text. Offhand I don't know a good way to do that. Google is suggesting creating a user control with a PictureBox and using the TextHeight method.

EDIT There's another approach, which I'm using in some of my projects. Just continue to use the SSPanel despite it's being unsupported and with awareness of its various problems. It does seem to work fine on Vista and XP - haven't tested yet on Windows 7.

MarkJ
I need to use them in several places and they need to be dynamically resized an have the same interface (same events, etc.) as the ssPanel so that I don't need to recode a bunch of stuff.Specific functionality is: displaying text in the center of the panel and (ideally) having a "raised" 3d edge.
Clay Nichols
Do you mean centring the text *vertically*? The intrinsic VB6 Label can centre text horizontally, but not vertically. The SSPanel supports both.
MarkJ
+1  A: 

There is no list of supported controls: you have to look at the list of supported OCX files in the Microsoft Support Statement for VB6. You need to figure out which controls are in those OCXs. You could start a new VB6 project, tick the OCXs in Project-Components, and see which controls become available in the toolbar.

Confession I have made this answer Community Wiki, because this information was originally in a comment to another answer, but that answer is now deleted. Feel slightly guilty as I downvoted the answer (it said VB6 is unsupported which is misleading).

MarkJ
A: 

Just as a side note to expand on MarkJ's thought (I realize this question is a little old, but I recently had to deal with porting some old VB apps): There are some cases where SSPanel is used as a container with background colors, and without text. Although it may seem like stating the obvious, the Forms.Panel does work fairly well class to avoid the "Sheridan 3D Controls" dependency and make distribution easier in these simple cases.

The VB.net converter tool may generate something like:

Public WithEvents ssPanel As AxThreed.AxSSPanel
Me.ssPanel = New AxThreed.AxSSPanel
ssPanel.OcxState = CType(resources.GetObject("ssPanel.OcxState"),
                         System.Windows.Forms.AxHost.State)
CType(Me.ssPanel, System.ComponentModel.ISupportInitialize).EndInit()

Which is easily changed to:

Friend WithEvents ssPanel As System.Windows.Forms.Panel
me.ssPanel = New System.Windows.Forms.Panel
' No longer necessary:
' ssPanel.OcxState
' CType(Me.ssPanel, System.ComponentModel.ISupportInitialize).EndInit()
JamesK
I think this is VB.net code, not VB6 code.
Clay Nichols