[帮助]担心班级图书馆 [英] [HELP] Worried About Class Library

查看:59
本文介绍了[帮助]担心班级图书馆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将类库放在表单上后,这些代码是否在主项目中是否正常?



这里:



Is it normal for these codes to be in the main project after class library has been placed on the form?

Here:

Private Sub InitializeComponent()
       Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
       Me.CustomButton1 = New Custom_Button.CustomButton
       Me.CustomButton21 = New Custom_Button.CustomButton2
       Me.SuspendLayout()
       '
       'CustomButton1
       '
       Me.CustomButton1.BackgroundImage = CType(resources.GetObject("CustomButton1.BackgroundImage"), System.Drawing.Image)
       Me.CustomButton1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
       Me.CustomButton1.Cursor = System.Windows.Forms.Cursors.Hand
       Me.CustomButton1.FlatAppearance.BorderSize = 0
       Me.CustomButton1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent
       Me.CustomButton1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent
       Me.CustomButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
       Me.CustomButton1.ForeColor = System.Drawing.Color.White
       Me.CustomButton1.Location = New System.Drawing.Point(29, 12)
       Me.CustomButton1.Name = "CustomButton1"
       Me.CustomButton1.Size = New System.Drawing.Size(265, 93)
       Me.CustomButton1.TabIndex = 0
       Me.CustomButton1.UseVisualStyleBackColor = True
       '
       'CustomButton21
       '
       Me.CustomButton21.BackgroundImage = CType(resources.GetObject("CustomButton21.BackgroundImage"), System.Drawing.Image)
       Me.CustomButton21.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
       Me.CustomButton21.Cursor = System.Windows.Forms.Cursors.Hand
       Me.CustomButton21.FlatAppearance.BorderSize = 0
       Me.CustomButton21.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent
       Me.CustomButton21.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent
       Me.CustomButton21.FlatStyle = System.Windows.Forms.FlatStyle.Flat
       Me.CustomButton21.ForeColor = System.Drawing.Color.White
       Me.CustomButton21.Location = New System.Drawing.Point(29, 111)
       Me.CustomButton21.Name = "CustomButton21"
       Me.CustomButton21.Size = New System.Drawing.Size(265, 98)
       Me.CustomButton21.TabIndex = 1
       Me.CustomButton21.UseVisualStyleBackColor = True
       '
       'Form1
       '
       Me.ClientSize = New System.Drawing.Size(324, 223)
       Me.Controls.Add(Me.CustomButton21)
       Me.Controls.Add(Me.CustomButton1)
       Me.Name = "Form1"
       Me.ResumeLayout(False)

   End Sub





谢谢。



Thanks.

推荐答案

它应该在设计器源文件中,除非你已经移动了将InitilizeComponent方法放入您自己的代码中 - 即(如Richard所说)标准框架初始化代码,通常位于MyForm.designer.vb文件中 - 除非在早期版本的VS for .NET(IIRC)中没有将两者分开以及现在将它们分开。
It should be in the designer source files, unless you have moved the InitilizeComponent method into your own code - that is (as Richard says) standard framework initialization code which is normally in the "MyForm.designer.vb" file - except in very early versions of VS for .NET (IIRC) which didn't separate the two as well as they do now.


这篇关于[帮助]担心班级图书馆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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