Operation Steps:
1. Create a new project Csframework3.test, create a new Formman window under the Csframework3.test project (no inheritance is required at this time).
2. Press F7 to open the class and replace the reference
Using System;
Using System.Collections.Generic;
Using System.Windows.Forms;
Using Csframework3.interfaces;
Using Csframework.library;
Using Csframework.common;
At this point the following three modules will be error, because the frame window does not refer to these three modules. Add Reference
Csframework3.interfaces Common System Interface module
Csframework.common Shared Public Module
Csframework.library the base Class library module is not shared
3. Inherit module main form base class, change form to Frmmodulebase
public partial class Formman:frmmodulebase
If a designer error occurs, delete the error code in Fromman.designer because the inheritance window relationship does not generate code automatically.
4, open the design page, search the tool MenuStrip Add a menu control, save. (If the above operation is unsuccessful)
5. Create the project directly using the Inheritance window. (delete items that are not successful)
6, open the design page, search the tool MenuStrip Add a menu control, save.
The test button in the diagram is copied over. MenuStrip is the menu that is added.
7, down so that the above reference to replace. Add the following red code to the initial method.
Public Frmdocumentmanagementman ()
{
InitializeComponent ();
_moduleid = CSFramework3.Interfaces.ModuleID.DocumentManagement;//Set module number
_modulename = modulenames.documentmanagement;//Set module name
Menustrip1.text = modulenames.documentmanagement; Same as Assemblymoduleentry.modulename definition
This. Mainmenustrip = THIS.MENUSTRIP1;
This. Setmenutag ();
}
Under normal circumstances Setmenutag (), and Documentmanagement will error, because there is no way to implement it. Continue to add the red code,
Documentmanagement error is not set menu name, temporarily regardless.
public override MenuStrip Getmodulemenu ()//Provide a menu system for Windows
{
return this.menustrip1;
}
private void Setmenutag ()
{
Menuoperationmain.tag = new Menuitemtag (Menutype.itemowner, (int) CSFramework3.Interfaces.ModuleID.PurchaseModule, Authoritycategory.none);
Btnsales.tag = new Menuitemtag (menutype.dataform, (int) CSFramework3.Interfaces.ModuleID.OperationPlan, Authoritycategory.master_action);
}
May Menuoperationmain and Btnsales error, change to the corresponding name, menu name and button name designer property to find.
8, found in the class ModuleID press F12
Set the menu ID and name, and do not add commas to the last one. Copy the name tests and open the class Fromman. Change the documentmanagement of the error to tests
9, find this class open, modify the inside of the reference and code.
Replace reference
Using System.Reflection;
Using System.Runtime.CompilerServices;
Using System.Runtime.InteropServices;
Using Csframework.library;
Using Csframework3.interfaces;
Using Csframework.core;
Replace note Red Section
[Assembly:assemblymoduleentry (ModuleID. Tests, Modulenames. tests, "CSFramework3.test.FormMan")]//this line needs to be added manually
[Assembly:assemblytitle ("csframework3.test")]
[Assembly:assemblydescription ("")]
[Assembly:assemblyconfiguration ("")]
[Assembly:assemblycompany ("Microsoft")]
[Assembly:assemblyproduct ("csframework3.test")]
[Assembly:assemblycopyright ("Copyright? Microsoft 2017 ")]
[Assembly:assemblytrademark ("")]
[Assembly:assemblyculture ("")]
10. Right click on Project Properties.
Note the red part. Contact QQ78474580
Add a new project instance using the C # Development/S Framework Premium version