AdvancedHMI Software
General Category => Support Questions => Topic started by: MikeF on October 19, 2017, 05:55:15 PM
-
I'm having some issues using templates to create multiple similar forms in my project. I've been following the procedure in this post: http://advancedhmi.com/forum/index.php?topic=1174.0 (http://advancedhmi.com/forum/index.php?topic=1174.0)
After adding the template into the project a prompt appears (error1.jpg) and the design time error page loads (error2.jpg).
Anyone seen this before?
-
If you click on the hyperlink for the error, does it take you to the line of code? If so, what is the code?
-
The link goes to the code view of the designer page. (HMIPromptPage1.Designer.vb)
Looks like all of the components on the template page are causing errors. The first of many lines with errors is this :
Me.Label1 = New System.Windows.Forms.Label()
-
Let's back up to the first error:
- In Solution Explorer, right click the AdvancedHMI project and select properties
- Select the References tab
- Do you see these 4 references:
AdvancedHMIControls
AdvancedHMIDrivers
MfgControl.AdvancedHMI.Controls
MfgControl.AdvancedHMI.Drivers
If not, select Add Reference, then add them to the list
-
Yup. Those are all there.
-
In the designer code where the error is reported, at the bottom do you see several lines of code similar to this:
Friend WithEvents Label1 As Label
-
Yes.
Every component on the template form has a line similar to that.
-
Go to the top of the page and check the class name to make sure it is not the same name used on another form.
-
The Class name is the same As the form I used to create the template. Do I need to manually change this for every instance of the template?
-
When you added the object, it should have ask for a file name, then gave that name to the form. If it didn't, then you will need to change it's name it two places. In the designer code, then in the regular form code (by right clicking the form in Solution Explorer, then select View Code)
-
Awesome, that seems to have cleared up all the errors. Thanks for the quick response Archie