Vb表单项目resx到resx文件 [英] Vb form project resx to resx file

查看:97
本文介绍了Vb表单项目resx到resx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,我们使用的是visual studio 2015.我有几个旧的2010 Windows窗体应用程序,其中resx文件位于代码文件(.vb)中。由于额外的(2000-7000)行,这使得编译器非常慢。



我想在.vb而不是设计师文件中获取Windows Form Designer生成的代码



示例:



< System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.OKButton = New System.Windows.Forms.Button
Me.AppTitleLabel = New System.Windows.Forms.Label
Me.GroupBox1 = New System.Windows。 Forms.GroupBox
Me.AppDescriptionLabel = New System.Windows.Forms.Label
Me.AppVersionLabel = New System.Windows.Forms.Label
Me.AppCopyrightLabel = New System.Windows.Forms。 Label
Me.SysInfoButton = New System.Windows.Forms.Button
Me.AppDateLabel = New System.Windows.Forms.Label
Me.ImagePictureBox = New System.Windows.Forms.PictureBox
Me.DetailsButton = New System.Windows.Forms.Button





此代码适用于vb脚本文件中的所有2010应用程序。

如果我将它复制粘贴在一个单独的设计器文件中,它会创建一个新的窗体设计器。有没有人有一个解决办法让这个分开而不(重新)建立一个新的设计文件(工具或其他东西)?



我尝试过:



手动复制resx文件。

在论坛上搜索解决方案。

解决方案

将表单拆分为部分类是你使用能够做一个宏 [ ^ ]。但不幸的是,在VS2012中删除了宏。



CodeProject上有VS2012的加载项 - 我不确定它是否适用于VS2015:

Visual Studio添加 - 将Windows窗体设计器生成的代码从.vb文件移动到.Designer.vb文件 [ ^ ]



还有一个独立的工具,声称支持VS2010项目:

DeCodEx | CoolSoft [ ^ ]



如果这些都不起作用,您可以随时手动拆分文件:

visual studio - 将旧的.NET代码拆分为设计器的部分类 - Stack Overflow [ ^ ]

I running into a problem sinds we using visual studio 2015. I have a couple of old 2010 windows form application with the resx file inside the code file (.vb). This make the compiler very slow because of the extra (2000-7000) lines.

I want to get ride of Windows Form Designer generated code inside the .vb instead of designer file

Example:

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
      Me.OKButton = New System.Windows.Forms.Button
      Me.AppTitleLabel = New System.Windows.Forms.Label
      Me.GroupBox1 = New System.Windows.Forms.GroupBox
      Me.AppDescriptionLabel = New System.Windows.Forms.Label
      Me.AppVersionLabel = New System.Windows.Forms.Label
      Me.AppCopyrightLabel = New System.Windows.Forms.Label
      Me.SysInfoButton = New System.Windows.Forms.Button
      Me.AppDateLabel = New System.Windows.Forms.Label
      Me.ImagePictureBox = New System.Windows.Forms.PictureBox
      Me.DetailsButton = New System.Windows.Forms.Button



This code is for all 2010 application in the vb script file.
if i copy paste this in a seperated designer file its creating a new windows form designer. Does anyone have a solution to get this separated without (re)building a new design file (a tool or something)?

What I have tried:

Copy resx file by hand.
Searching on forum for solution.

解决方案

Splitting a form into partial classes is the sort of thing you used to be able to do with a macro[^]. But unfortunately, macros were removed in VS2012.

There's an add-in for VS2012 on CodeProject - I'm not sure if it will work in VS2015:
A Visual Studio add-in to move Windows Forms Designer generated code from a .vb file to a .Designer.vb file[^]

There's also a stand-alone tool, which claims to support VS2010 projects:
DeCodEx | CoolSoft[^]

If neither of those work, you can always split the file manually:
visual studio - Split old .NET code into designer partial class - Stack Overflow[^]


这篇关于Vb表单项目resx到resx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆