如何从多个 VB6 .frm 文件中删除所有代码并保留表单设计?
我有一个大型 VB6 应用程序,其中包含许多 .frm
文件。我想基本上从所有表单中“删除”代码,只留下 GUI 设计。
快速执行此任务的最佳方法是什么?
I have a large VB6 app with many .frm
files. I want to basically 'gut' the code from all the forms and just leave the GUI design.
What would be the best way to perform this task quickly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您确实有足够的表单,则不能只打开每个表单并 Ctrl + A、Del、Ctrl + S 那么你总是可以编写一个快速的 VB 程序来完成它。 Visual Basic 将显示表单所需的信息放在文件的开头,后跟代码。将每个 .frm 文件复制到备份,打开它并将最后一个 Attribute ... 行之前的所有内容写入具有原始文件名的新文件中。相当脏,但应该只需要大约 15-20 分钟即可写入,并为您留下备份以防出现错误。
.frm 内容示例
If you really have enough forms that you can't just open each form and Ctrl + A, Del, Ctrl + S Then you can always write a quick VB program to do it. Visual Basic puts the information needed to display the form at the beginning of the file followed by the code. Copy each .frm file to a backup, open it and write everything up to the last Attribute ... line to a new file with the original file name. Pretty dirty, but should only take about 15-20 minutes to write and leaves you a backup in case of error.
Sample .frm content
我猜这是一个老问题,但如果您仍然对重构某些 VB6 项目感兴趣,请查看我的 VBFormDesign 过滤工具,网址为 http ://zoomicon.com/tranxform/
Guess this is an old question, but if you're still interested in refactoring some VB6 project, check out my VBFormDesign filter tool at http://zoomicon.com/tranxform/