Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3433526
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:35:13+00:00 2026-05-18T07:35:13+00:00

I want to pass data from form1 to form2 and i used The Properties

  • 0

I want to pass data from form1 to form2 and i used “The Properties Approach” as shown in this article: http://www.vbdotnetheaven.com/UploadFile/thiagu304/passdata12262006073406AM/passdata.aspx

But i have following error occurd withEvents variable 'Label1' implicitly defines 'Label1', which conflicts with a member of the same name in class 'Form2'

Form1

      Private ReadOnly Property _Label1() As String
        Get
            Return Label1.Text
        End Get
    End Property

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked

        Dim frm As Form2 = New Form2
        frm._Label1 = _Label1
        frm.Show()
    End Sub

Form2

   Friend WriteOnly Property _Label1() As String
    Set(ByVal Value As String)
        Label1.Text = Value
    End Set
End Property
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:35:13+00:00Added an answer on May 18, 2026 at 7:35 am

    Friend WriteOnly Property _Label1() As String

    Confuzzling error message but the problem is induced by the name you picked. There’s a control on that form with the name Label1. The Windows Forms designer created a declaration for it that you can use in your code with the Handles keyword, handy to create event handlers for the control. The WithEvents keyword makes the compiler auto-generate some code for that variable. Including a hidden field, it looks like this with ildasm.exe:

    .field private class [System.Windows.Forms]System.Windows.Forms.Label _Label1
    .custom instance void [mscorlib]System.Runtime.CompilerServices.AccessedThroughPropertyAttribute::.ctor(string) = ( 01 00 06 4C 61 62 65 6C 31 00 00 )                // ...Label1..
    

    Note the name that the compiler picked for that hidden field. Yup _Label1, exactly the same name you picked for your property. Kaboom.

    Pick a name, any name, just not one that starts with an underscore.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to pass data from second tab to first tab using delegates.But delegate
I want to pass data from database to JSF page as a table. I
i have two flex applications and i want to pass the data from one
My data is just number, I want pass it from VC1 to VC2 for
i actually take this code form vogella.com . i want to pass the data
I want to pass a custom made vector object containing data from background service
I want to pass data between a Python and a C# application in Windows
I have two pages and I want to pass data to each other. How
I have an NSMutableArray of names. I want the pass the data (selected name)
I am writing an android app. I want to pass some data across the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.