Jump to content
Xtreme .Net Talk

variable 'Name' conflicts with property 'Name'


Recommended Posts

Posted

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

 

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

Posted

if i read ur question correctly here's what i think:

 

 

when u run ur project, it will ask you something like, "sub main was not found, run anyway?" <-- im doin this off the top of my head, so excuse me if im wrong about the mesage

 

click no

 

in the error box at the bottom, double click the one that says something about "sub main was not found in (yourprojectname)"

 

a dialog box will popup, select the form that u want to startup and ur done

 

sorry if i misnterpreted ur question, im not too sure what u mean

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted

Thank you very much for the help. I found out that I have a veriable name called "Name" which is a reserved word.

 

It's working now.

 

Thanks!

 

ljCharlie

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...