目前我是新手,我正在尝试让这一切正常工作,现在我已经研究并制作了一个模块,允许我更改内部网络浏览器的用户代理,以便我可以操作很容易,但这就是问题所在。
我假设我必须编辑自动生成的代码,因为文件本身被称为“Form1.Designer.vb”,我不知道从哪里开始放入自定义代码来覆盖当前代码,比如我想做类似的事情这;
Me.WebSiteBrowser1.Dock = System.Windows.Forms.DockStyle.Fill
Me.WebSiteBrowser1.Location = New System.Drawing.Point(3, 3)
Me.WebSiteBrowser1.MinimumSize = New System.Drawing.Size(20, 20)
Me.WebSiteBrowser1.Name = "WebSiteBrowser1"
Me.WebSiteBrowser1.Size = New System.Drawing.Size(671, 413)
Me.WebSiteBrowser1.TabIndex = 0
ChangeUserAgent("This is after the url agent gets changed after the first url open")
Me.WebSiteBrowser1.Navigate("http://www.whatsmyuseragent.com/", Nothing, Nothing, "User-Agent: This is the first open url agent")
但是,每当我更改可视模板中的任何内容时,它都会自动重置回
Me.WebSiteBrowser1.Dock = System.Windows.Forms.DockStyle.Fill
Me.WebSiteBrowser1.Location = New System.Drawing.Point(3, 3)
Me.WebSiteBrowser1.MinimumSize = New System.Drawing.Size(20, 20)
Me.WebSiteBrowser1.Name = "WebSiteBrowser1"
Me.WebSiteBrowser1.Size = New System.Drawing.Size(671, 413)
Me.WebSiteBrowser1.TabIndex = 0
所以我的问题是我在哪里编写自定义代码,以便在视觉创建者自动生成之后保留它?