Lan Solo Posted June 11, 2003 Posted June 11, 2003 ...But I still have the interface design that took me forever to create. Is there a way to create a new solution and use an existing interface design without having to start from scratch on the design? Or is there a way to "fix" the code that I broke? Any help would be appreciated. -Greg Quote
ashrobo Posted June 11, 2003 Posted June 11, 2003 not too sure about this, but maybe copying and pasting the controls on a new form might get back the code? what you want to get back are the codes for the controls right? - ashrobo Quote
aewarnick Posted June 11, 2003 Posted June 11, 2003 Yes you can fix it but how bad is it messed up? Can you post the part of code you think you messed up? Quote C#
Lan Solo Posted June 11, 2003 Author Posted June 11, 2003 I'm not sure how messed up it is. I think I deleted one-too-many lines. Here is the part of the code that I modified. #Region " Windows Form Designer generated code" 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer Quote
aewarnick Posted June 11, 2003 Posted June 11, 2003 If that is all you messed up, you can just create a new solution and copy and paste over it. It's always the same. At least, as far as I've seen. Quote C#
Lan Solo Posted June 11, 2003 Author Posted June 11, 2003 Ok, I pasted in this portion of code: #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) 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() components = New System.ComponentModel.Container() Me.Text = "Form1" End Sub #End Region It says that "InitializeComponect" has multiple definitions. These line of code seem to be the only difference but when I click start it loads a blank interface instead of the one with all my controls. The code for the controls is still there though??!! Quote
aewarnick Posted June 11, 2003 Posted June 11, 2003 The part I meant was just: Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub Oh, and to paste code that is color coded for VB i think you use vb in brackets. Quote C#
Lan Solo Posted June 11, 2003 Author Posted June 11, 2003 Thanks for the posting tip. It's still erroring out. I pasted in the code from a new solution. Any ideas what I might be doing wrong? I'm a newbie so let me know if I'm in the wrong forum. The entire message in the pop-up tip is: Method 'InitializeComponent' has multiple definitions with identical signatures Thanks in advance Quote
dsgreen57 Posted June 11, 2003 Posted June 11, 2003 InitializeComponent must be defined twice, it isn't within the pasted code but do a search for it and you should found a duplicate definition. Quote
Lan Solo Posted June 11, 2003 Author Posted June 11, 2003 I found it. Thank you everyone for you help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.