2017-10-05 116 views
-1

我有一些情況。我正在使用Visual Studio 2017.從Form1.vb我的代碼已消失。所有組件都保存在Form1.Designer.vb中。但我無法恢復它。Form1.vb中的代碼已經消失

這裏是我的代碼形式Form1.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> 
Partial Class NotePadApp 
Inherits System.Windows.Forms.Form 

'Form overrides dispose to clean up the component list. 
<System.Diagnostics.DebuggerNonUserCode()> 
Protected Overrides Sub Dispose(ByVal disposing As Boolean) 
    Try 
     If disposing AndAlso components IsNot Nothing Then 
      components.Dispose() 
     End If 
    Finally 
     MyBase.Dispose(disposing) 
    End Try 
End Sub 

'Required by the Windows Form Designer 
Private components As System.ComponentModel.IContainer 

'NOTE: The following procedure is required by the Windows Form Designer 
'It can be modified using the Windows Form Designer. 
'Do not modify it using the code editor. 
<System.Diagnostics.DebuggerStepThrough()> 
Private Sub InitializeComponent() 
    Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(NotePadApp)) 
    Me.MenuBar = New System.Windows.Forms.MenuStrip() 
    Me.FileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.NewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.OpenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.SaveToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.SaveAsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() 
    Me.ExitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.FontToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.ToolStripSeparator5 = New System.Windows.Forms.ToolStripSeparator() 
    Me.UndoToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator() 
    Me.CutToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.CopyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.PasteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator() 
    Me.FindToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.ReplaceToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator() 
    Me.SelectAllToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.ViewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.RichTextBox = New System.Windows.Forms.RichTextBox() 
    Me.EventLog1 = New System.Diagnostics.EventLog() 
    Me.ThemesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.EyesFriendlyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.WhiteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.DarkToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() 
    Me.MenuBar.SuspendLayout() 
    CType(Me.EventLog1, System.ComponentModel.ISupportInitialize).BeginInit() 
    Me.SuspendLayout() 
    ' 
    'MenuBar 
    ' 
    Me.MenuBar.ImageScalingSize = New System.Drawing.Size(20, 20) 
    Me.MenuBar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileToolStripMenuItem, Me.EditToolStripMenuItem, Me.ViewToolStripMenuItem}) 
    Me.MenuBar.Location = New System.Drawing.Point(0, 0) 
    Me.MenuBar.Name = "MenuBar" 
    Me.MenuBar.Padding = New System.Windows.Forms.Padding(5, 2, 0, 2) 
    Me.MenuBar.Size = New System.Drawing.Size(1085, 28) 
    Me.MenuBar.TabIndex = 0 
    Me.MenuBar.Text = "MenuStrip1" 
    ' 
    'FileToolStripMenuItem 
    ' 
    Me.FileToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.NewToolStripMenuItem, Me.OpenToolStripMenuItem, Me.SaveToolStripMenuItem, Me.SaveAsToolStripMenuItem, Me.ToolStripSeparator1, Me.ExitToolStripMenuItem}) 
    Me.FileToolStripMenuItem.Name = "FileToolStripMenuItem" 
    Me.FileToolStripMenuItem.Size = New System.Drawing.Size(44, 24) 
    Me.FileToolStripMenuItem.Text = "File" 
    ' 
    'NewToolStripMenuItem 
    ' 
    Me.NewToolStripMenuItem.Name = "NewToolStripMenuItem" 
    Me.NewToolStripMenuItem.Size = New System.Drawing.Size(181, 26) 
    Me.NewToolStripMenuItem.Text = "New" 
    ' 
    'OpenToolStripMenuItem 
    ' 
    Me.OpenToolStripMenuItem.Name = "OpenToolStripMenuItem" 
    Me.OpenToolStripMenuItem.Size = New System.Drawing.Size(181, 26) 
    Me.OpenToolStripMenuItem.Text = "Open..." 
    ' 
    'SaveToolStripMenuItem 
    ' 
    Me.SaveToolStripMenuItem.Name = "SaveToolStripMenuItem" 
    Me.SaveToolStripMenuItem.Size = New System.Drawing.Size(181, 26) 
    Me.SaveToolStripMenuItem.Text = "Save" 
    ' 
    'SaveAsToolStripMenuItem 
    ' 
    Me.SaveAsToolStripMenuItem.Name = "SaveAsToolStripMenuItem" 
    Me.SaveAsToolStripMenuItem.Size = New System.Drawing.Size(181, 26) 
    Me.SaveAsToolStripMenuItem.Text = "Save As..." 
    ' 
    'ToolStripSeparator1 
    ' 
    Me.ToolStripSeparator1.Name = "ToolStripSeparator1" 
    Me.ToolStripSeparator1.Size = New System.Drawing.Size(178, 6) 
    ' 
    'ExitToolStripMenuItem 
    ' 
    Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem" 
    Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(181, 26) 
    Me.ExitToolStripMenuItem.Text = "Exit" 
    ' 
    'EditToolStripMenuItem 
    ' 
    Me.EditToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FontToolStripMenuItem, Me.ToolStripSeparator5, Me.UndoToolStripMenuItem, Me.ToolStripSeparator2, Me.CutToolStripMenuItem, Me.CopyToolStripMenuItem, Me.PasteToolStripMenuItem, Me.ToolStripSeparator3, Me.FindToolStripMenuItem, Me.ReplaceToolStripMenuItem, Me.ToolStripSeparator4, Me.SelectAllToolStripMenuItem}) 
    Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" 
    Me.EditToolStripMenuItem.Size = New System.Drawing.Size(47, 24) 
    Me.EditToolStripMenuItem.Text = "Edit" 
    ' 
    'FontToolStripMenuItem 
    ' 
    Me.FontToolStripMenuItem.Name = "FontToolStripMenuItem" 
    Me.FontToolStripMenuItem.Size = New System.Drawing.Size(146, 26) 
    Me.FontToolStripMenuItem.Text = "Font" 
    ' 
    'ToolStripSeparator5 
    ' 
    Me.ToolStripSeparator5.Name = "ToolStripSeparator5" 
    Me.ToolStripSeparator5.Size = New System.Drawing.Size(143, 6) 
    ' 
    'UndoToolStripMenuItem 
    ' 
    Me.UndoToolStripMenuItem.Name = "UndoToolStripMenuItem" 
    Me.UndoToolStripMenuItem.Size = New System.Drawing.Size(146, 26) 
    Me.UndoToolStripMenuItem.Text = "Undo" 
    ' 
    'ToolStripSeparator2 
    ' 
    Me.ToolStripSeparator2.Name = "ToolStripSeparator2" 
    Me.ToolStripSeparator2.Size = New System.Drawing.Size(143, 6) 
    ' 
    'CutToolStripMenuItem 
    ' 
    Me.CutToolStripMenuItem.Name = "CutToolStripMenuItem" 
    Me.CutToolStripMenuItem.Size = New System.Drawing.Size(146, 26) 
    Me.CutToolStripMenuItem.Text = "Cut" 
    ' 
    'CopyToolStripMenuItem 
    ' 
    Me.CopyToolStripMenuItem.Name = "CopyToolStripMenuItem" 
    Me.CopyToolStripMenuItem.Size = New System.Drawing.Size(146, 26) 
    Me.CopyToolStripMenuItem.Text = "Copy" 
    ' 
    'PasteToolStripMenuItem 
    ' 
    Me.PasteToolStripMenuItem.Name = "PasteToolStripMenuItem" 
    Me.PasteToolStripMenuItem.Size = New System.Drawing.Size(146, 26) 
    Me.PasteToolStripMenuItem.Text = "Paste" 
    ' 
    'ToolStripSeparator3 
    ' 
    Me.ToolStripSeparator3.Name = "ToolStripSeparator3" 
    Me.ToolStripSeparator3.Size = New System.Drawing.Size(143, 6) 
    ' 
    'FindToolStripMenuItem 
    ' 
    Me.FindToolStripMenuItem.Name = "FindToolStripMenuItem" 
    Me.FindToolStripMenuItem.Size = New System.Drawing.Size(146, 26) 
    Me.FindToolStripMenuItem.Text = "Find" 
    ' 
    'ReplaceToolStripMenuItem 
    ' 
    Me.ReplaceToolStripMenuItem.Name = "ReplaceToolStripMenuItem" 
    Me.ReplaceToolStripMenuItem.Size = New System.Drawing.Size(146, 26) 
    Me.ReplaceToolStripMenuItem.Text = "Replace" 
    ' 
    'ToolStripSeparator4 
    ' 
    Me.ToolStripSeparator4.Name = "ToolStripSeparator4" 
    Me.ToolStripSeparator4.Size = New System.Drawing.Size(143, 6) 
    ' 
    'SelectAllToolStripMenuItem 
    ' 
    Me.SelectAllToolStripMenuItem.Name = "SelectAllToolStripMenuItem" 
    Me.SelectAllToolStripMenuItem.Size = New System.Drawing.Size(146, 26) 
    Me.SelectAllToolStripMenuItem.Text = "Select All" 
    ' 
    'ViewToolStripMenuItem 
    ' 
    Me.ViewToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ThemesToolStripMenuItem}) 
    Me.ViewToolStripMenuItem.Name = "ViewToolStripMenuItem" 
    Me.ViewToolStripMenuItem.Size = New System.Drawing.Size(53, 24) 
    Me.ViewToolStripMenuItem.Text = "View" 
    ' 
    'RichTextBox 
    ' 
    Me.RichTextBox.BackColor = System.Drawing.SystemColors.Window 
    Me.RichTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None 
    Me.RichTextBox.Dock = System.Windows.Forms.DockStyle.Fill 
    Me.RichTextBox.Font = New System.Drawing.Font("Courier New", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) 
    Me.RichTextBox.ForeColor = System.Drawing.Color.Black 
    Me.RichTextBox.Location = New System.Drawing.Point(0, 28) 
    Me.RichTextBox.Name = "RichTextBox" 
    Me.RichTextBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedBoth 
    Me.RichTextBox.Size = New System.Drawing.Size(1085, 544) 
    Me.RichTextBox.TabIndex = 1 
    Me.RichTextBox.Text = "" 
    Me.RichTextBox.WordWrap = False 
    ' 
    'EventLog1 
    ' 
    Me.EventLog1.SynchronizingObject = Me 
    ' 
    'ThemesToolStripMenuItem 
    ' 
    Me.ThemesToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EyesFriendlyToolStripMenuItem, Me.WhiteToolStripMenuItem, Me.DarkToolStripMenuItem}) 
    Me.ThemesToolStripMenuItem.Name = "ThemesToolStripMenuItem" 
    Me.ThemesToolStripMenuItem.Size = New System.Drawing.Size(181, 26) 
    Me.ThemesToolStripMenuItem.Text = "Themes" 
    ' 
    'EyesFriendlyToolStripMenuItem 
    ' 
    Me.EyesFriendlyToolStripMenuItem.Checked = True 
    Me.EyesFriendlyToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked 
    Me.EyesFriendlyToolStripMenuItem.Name = "EyesFriendlyToolStripMenuItem" 
    Me.EyesFriendlyToolStripMenuItem.Size = New System.Drawing.Size(181, 26) 
    Me.EyesFriendlyToolStripMenuItem.Text = "Eyes Friendly" 
    ' 
    'WhiteToolStripMenuItem 
    ' 
    Me.WhiteToolStripMenuItem.Name = "WhiteToolStripMenuItem" 
    Me.WhiteToolStripMenuItem.Size = New System.Drawing.Size(181, 26) 
    Me.WhiteToolStripMenuItem.Text = "White" 
    ' 
    'DarkToolStripMenuItem 
    ' 
    Me.DarkToolStripMenuItem.Name = "DarkToolStripMenuItem" 
    Me.DarkToolStripMenuItem.Size = New System.Drawing.Size(181, 26) 
    Me.DarkToolStripMenuItem.Text = "Dark" 
    ' 
    'NotePadApp 
    ' 
    Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) 
    Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font 
    Me.ClientSize = New System.Drawing.Size(1085, 572) 
    Me.Controls.Add(Me.RichTextBox) 
    Me.Controls.Add(Me.MenuBar) 
    Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) 
    Me.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) 
    Me.Name = "NotePadApp" 
    Me.Text = "NotePadApp" 
    Me.MenuBar.ResumeLayout(False) 
    Me.MenuBar.PerformLayout() 
    CType(Me.EventLog1, System.ComponentModel.ISupportInitialize).EndInit() 
    Me.ResumeLayout(False) 
    Me.PerformLayout() 

End Sub 

Friend WithEvents MenuBar As MenuStrip 
Friend WithEvents FileToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents OpenToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents SaveAsToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents NewToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents SaveToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents ToolStripSeparator1 As ToolStripSeparator 
Friend WithEvents ExitToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents EditToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents FontToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents ToolStripSeparator5 As ToolStripSeparator 
Friend WithEvents UndoToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents ToolStripSeparator2 As ToolStripSeparator 
Friend WithEvents CutToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents CopyToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents PasteToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents ToolStripSeparator3 As ToolStripSeparator 
Friend WithEvents FindToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents ReplaceToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents ToolStripSeparator4 As ToolStripSeparator 
Friend WithEvents SelectAllToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents ViewToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents RichTextBox As RichTextBox 
Friend WithEvents EventLog1 As EventLog 
Friend WithEvents ThemesToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents EyesFriendlyToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents WhiteToolStripMenuItem As ToolStripMenuItem 
Friend WithEvents DarkToolStripMenuItem As ToolStripMenuItem 
End Class 

任何建議如何我可以還原。 另外我沒有備份,因爲我開始像兩天前的項目。

歡迎任何幫助!

最好的問候,

貝爾巴托夫Georgiev的

+1

經常保存,使用源代碼管理。 –

+0

從回收站中檢查;) – Fabio

回答

-1

如果您在文件打開文件位置並點擊右鍵,有還原以前版本的選項。如果你幸運的話,那裏可能有些東西。祝你好運。

enter image description here