Results 1 to 5 of 5

Thread: [RESOLVED] How to access Windows Form Designer generated code in 2008?

  1. #1

    Thread Starter
    Addicted Member riechan's Avatar
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    254

    Resolved [RESOLVED] How to access Windows Form Designer generated code in 2008?

    Is it possible to edit the Windows Form Designer generated code in VS2008?
    ====================
    ほんとにどもありがとう!

    Rie Ishida

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to access Windows Form Designer generated code in 2008?

    Open the Solution Explorer and click the Show All Files button. You can then expand your for to reveal a node for the designer code file.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member riechan's Avatar
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    254

    Re: How to access Windows Form Designer generated code in 2008?

    Is the Windows Form Designer code in the .resx file? And can I add code such as this?

    Code:
        Private Shared _instanceTransaction As frmTransaction
        Public Shared ReadOnly Property Instance() As frmTransaction
            Get
                If _instanceTransaction Is Nothing OrElse _instanceTransaction.IsDisposed Then
                    'There is no current instance so create one.                
                    _instanceTransaction = New frmTransaction
                End If
    
                'Return a reference to the one and only instance.          
                Return _instanceTransaction
            End Get
        End Property
    ====================
    ほんとにどもありがとう!

    Rie Ishida

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to access Windows Form Designer generated code in 2008?

    The designer code would be in the one with "designer" in the name.

    You shouldn't be touching the designer code file at all unless you specifically need to, which is generally only when something has gone awry. If all you want to do is add a property then that is not designer code; it's user code so it belongs in the user code file, i.e. the code file that you (the user) normally add and edit code in. Why should this particular property be any different?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Addicted Member riechan's Avatar
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    254

    Re: How to access Windows Form Designer generated code in 2008?

    I got it. Thanks.
    ====================
    ほんとにどもありがとう!

    Rie Ishida

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width