I am now looking at the SDKExamples builtin OPM CE. However I got a error that the sample windows form inside can't be open. the error code as shown
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: MyDialog --- The base class 'Bentley.MstnPlatformNET.WinForms.Adapter' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
Any idea? I have tried others windows form as well, but non of them works.
You Quanwu said:I am now looking at the SDKExamples builtin OPM CE.
please read and follow best practices! To write "SDKExamples builtin OPM CE" in common Developers and Programming Forum does not provide exact information about version, environment etc.
You Quanwu said:However I got a error that the sample windows form inside can't be open.
It's expected behavior and has been discussed many times (mostly for MicroStation V8i, but the issue is the same regardless product and version).
You Quanwu said:Any idea?
I think the error message is quite descriptive ... but to decipher it completely requires to understand WinForms (and GUI code in general) not through click-only interface, but at source code level: Whereas any Widows Form is a class inherited from System.Windows.Forms.Form, Bentley Windows Forms are inherited from Bentley.MstnPlatformNET.WinForms.Adapter class. And this class is not known and supported by VS designer.
The solution is to temporarily change the form to be inherited from Form class and not Adapter. When required changes are finished, it has to be changed back to Adapter, so it can be compiled.
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Thank you so much, Sir.
It's working. Cheers.