English 中文(简体)
原生VB6替代Sheridan 3D控件(如ssCommand,ssCheck等)
原标题:
  • 时间:2009-05-12 18:49:09
  •  标签:

I m working on an VB6 app and I d like to get rid of the old Sheridan controls and replace them with built in VB6 controls.

然而,其中一些控件具有一些不错的属性,如ssCommand按钮上的前景。标准的VB6命令按钮没有前景属性。

I know that VB6 potentially has lots of other controls that I can enable but I m not clear on which ones are fairly "standard" (i.e., not third party controls). I d like to keep this app as plain vanilla as possible and not create dependencies. (Yes, I know that any components for VB6 have long sense become abandonware. I just anticipate a higher level of compatibility from a built in VB6 control since it was probably used more and thus "pounded on" more and it s flaws would be more known.

有什么建议吗?

最佳回答

在我看来,threed32.ocx(Sheridan SSControls)应该被抛弃,因为它存在很多问题。它已经不再得到支持,所有的控件在可见时都会抢夺焦点,包括面板和框架(!),它很难升级到VB.NET - 这还不止。对于我的公司来说,这些问题足以抵消它提供的额外功能 - 我们将把它从所有程序中删除。

Some of the discussion is too pessimistic IMHO. VB6 is not abandonware yet - we re not all doomed - though no doubt we will have to upgrade the code one day. Microsoft say:

The VB6 runtime is supported for the full lifetime of Windows Vista, Windows Server 2008 and Windows 7, which is five years of mainstream support followed by five years of extended support.

Microsoft are still supporting a number of their VB6 controls. Check the online list and only use the controls that they do support. These are the standard, tested, supported controls Clay is looking for in the original question. If you want to use third-party components, check whether they are still supported by the vendor. I would agree that you should always think hard about how much benefit you re getting before you introduce dependencies, which can be a support headache. If you use special components, try to wrap them in an abstraction layer. It might save some pain later if you need to replace them. You can hide all the fancy features except the ones you really need.

A final word - don t use the ForeColor property in the SSCommand. There s no corresponding BackColor property, so you have no guarantee that your special foreground colour will contrast with the system background "button face" colour. Just like Raymond says.

问题回答

有时创意可以走很长远。例如,我希望我的VB6命令按钮具有自定义的背景和前景颜色,即使这违反了Windows标准外观;然而,由于我的项目不是商业性质,我不愿花费大量金钱来实现这种功能。所以我尝试了一些方法,最终选择了对我来说非常可行的解决方案:我在按钮上覆盖标签控件,现在拥有绝对真实的多彩按钮。我可以通过编程方式控制按钮颜色以反映各种操作状态,甚至超越简单的“点击/未点击”组合。我的一个应用程序使用了五个按钮组,这些按钮根据组合的按钮值而变成不同的颜色。

我认为保持应用程序的“纯净香草”是一个值得追求的目标。当然,这将简化部署的过程。

I d say the best way to find standard components for VB6 is to install VB6 (plus service packs) on a clean machine. All available components will be standard.

If you re unable to do this, for each checked Component or Reference in your project, research the file (dll, ocx, etc) referenced.

在这种情况下,你面临着一场艰苦的战斗。尝试消除对已死亡组件的依赖可能是一个不错的主意,但在这种情况下,你已经在一个被遗弃的技术上了。对我来说,用更现代的技术(例如,.NET)重建应用程序是不可行的,所以这只留下了你一些有限的选择。

  1. Replace the Sheridan controls with the existing VB6 controls which are a closest match, then update the code accordingly. This will be an intricate, difficult process, and you are correct in assuming that in many cases there won t be a match -- Sheridan (now Infragistics) built their business by providing UI capabilities which weren t in-box on VB6. In many cases, your UI will have to be seriously adapted to support this.
  2. Consider writing "good enough" versions of the controls in VB6 yourself, or even .NET (the latter using advice from this StackOverflow question).
  3. Consider replacing those controls with (likely long-since abandoned) open source VB6 controls. Google will be your friend here. The reason I recommend this route is that many UI elements have been represented in ActiveX over the years, as open source -- and if they re open source, you can at least "support yourself" on them.

I know you re going for a plain-vanilla out-of-box VB6 deployment, but for some UI elements, that may not be feasible. If you can rebuild your UI to #1 specs, then go for it, but you may have so much work cut out for you there that it might be time to consider going for the gusto and rebuilding on a modern, supported platform.

我经历过这种情况,你也需要经历相当长的时间,而且以我的经验看来,你对结果不会太满意。

VB6 总之不是长期解决方案。为什么不让它们留在那里呢?是的,它们已被抛弃,但我使用过它们,从来没有需要支持。 (而且第一次被购买后,一切都变得糟糕了。)我的经验是它们非常可靠。我只会继续使用它们,如果有局部问题,提供局部解决方案即可。

I have to disagree with your reasoning. One might expect better support from someone whose living depends on you being a happy customer.

这也很可能意味着任何依赖VB6销售的供应商很快就会破产。

为什么费心呢?如果你的产品有效,那就别担心了。我发现Sheridan的控制系统非常可靠。如果你没有遇到任何问题,那就不要再去管它们了。





相关问题
热门标签