VB.NET - NOT A MEMBER

VB.NET - NOT A MEMBER

cturlington
Collaborator Collaborator
1,009 Views
3 Replies
Message 1 of 4

VB.NET - NOT A MEMBER

cturlington
Collaborator
Collaborator

Hello,

 

I am using Civil 3D 2016 and MS Visual Studio 2013, practicing the VB.NET Autodesk labs.

 

I am having an issue with myPalette from Lab4 "not a member" of Lab5, since I have the labs written as separate projects, not together in the same project.  I tried making a current instance of myPalette in Lab5 by creating a declaration of myPalette by: "Dim myPalette As Lab4.myPalette.myPalette".  I also use the Imports statements and reference connecting Lab4 to Lab5.  I do not understand how myPalette would not be a member of Lab5.  What am I missing in my logic ?  Attached is my Lab5 and Lab4 code for your reference, the issue occurs in Lab5 at step 20.  Thanks in advance for any suggestions.

0 Likes
Accepted solutions (1)
1,010 Views
3 Replies
Replies (3)
Message 2 of 4

Jeff_M
Consultant
Consultant

@cturlington, you posted the vbproj files, not the actual code. You'd be best off zipping up your entire solution.

 

This sounds similar to a question you asked a week or two ago that I thought we resolved.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 4

cturlington
Collaborator
Collaborator

Jeff,

 

Please find attached my zipped project for both labs 4 and 5.  The question previously was about referencing together the projects, selecting the correct Imports and making some objects public in lab4, which I did.  With that in place, I am still getting a "not a member" error that is not getting resolved by referencing or the Public Shared keyword.  My understanding is I need to use a different statement in lieu of the "Me." statement since I am not running a current instance of myPalette in lab5.  I tried a few different approaches to use the Dim statement to bring the "myPalette" information into a new variable, as a member of lab5, but could not get it to work.  I doubt my understanding is 100% but that is what I am looking to improve.  Thanks in advance for any suggestions, they are appreciated.

0 Likes
Message 4 of 4

Jeff_M
Consultant
Consultant
Accepted solution

OK, looks like you missed a step in that previous conversation. The TreeView control in Lab4 needs the Modifier property changed from Friend to Public.

 

In Lab5, myCommands:

Remove "Imports LAB4.UserControl1" then make these edits to the code:

 

If myPalette Is Nothing Then
   LAB4.myPalette.myPalette.palette()  ''by doing this you don't force the user to run the Palette command from Lab4 first.
End If

If Not myPalette Is Nothing Then

     Dim myPalette As LAB4.myPalette.myPalette  ''you have just checked whether this exists, myPalette is coming from Lab4

     For Each node As Windows.Forms.TreeNode In Me.myPalette.TreeView1.Nodes


 

Jeff_M, also a frequent Swamper
EESignature