Results 1 to 3 of 3

Thread: variable 'Name' conflicts with property 'Name'

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2003
    Posts
    219

    Question variable 'Name' conflicts with property 'Name'

    I'm getting an error when I run the program with the following message:

    Code:
    C:\VB_Project\Computers\mainForm.vb variable 'Name' conflicts with property 'Name' in the base class 'Control' and so should be declared 'Shadows'.
    C:\VB_Project\Computers\mainForm.vb(1107): Value of type 'String' cannot be converted to 'System.Windows.Forms.DataGridTextBoxColumn'.\

    And when I look at line 1107, there's this code:

    Me.Name = "mainForm"

    If I delete this line or comment it out then the program runs fine but with a warning about conflict variable name. However, after a couple of runs, the program will generate the same exact above error again. And this time, if I look at the line, 1107, again, the code Me.Name = "mainForm" is back.

    Does anyone have any suggestion why this happened? If anyone wish to see my whole project to help me diagnose, I'm willing to attach it in here or send it to you. I'm greatly appreciate for any help I can get.

    Thank you,

    ljCharlie

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Search for a form level variable called name. If you find one change its name to something else.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2003
    Posts
    219

    Thumbs up

    Thank you very much for the help. You are exactly right. I have a variable name in the Tablesytle column name.

    It's working now.

    Thanks!

    ljCharlie

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