![]() |
【转帖】how to add a .net user control
how to add a .net user control
hi, i've benn trying to create an addin for sw2009 using .net 2005 c# to manage documents (assembly and parts) with company data (products, materials, ...). my addin works fine if i create forms called by menu or toolbar buttons. now i would like to create a user control to search data in a sql server database. is there an example on how to create a .net user control and use it in a pmp or in task pane ? i found examples about activex but this is an older tecnique, how to manage .net assemblies ? thank you. hello gianni, i am trying the same exercise in c#.net2.0. i have created the custom control and tested in web page which worls fine. i tried this following code to add the activex control in the task pan. which i tookas a vb reference to generate this piece of code. string parttemplate = swapp.getuserpreferencestringvalue((int)swconst.swuserpreferencestringvalue_e.swdefaulttemplatepart); swdoc = (imodeldoc2)swapp.newdocument(parttemplate, (int)swdwgpapersizes_e.swdwgpapera4size, 0, 0); mdliewmgr = swdoc.modelviewmanager; object xcont = taskpan.addcontrol("activexcontrol_test.activexcontrol_test") if (xcont == null) messagebox.show("unable to insert xcontrol"); but the problem is that it wont add the control and the api has no any return error code to undersatnd what's going wrong. if you got any solution please let me know as well at rbelkh@clydeunion.com thanks in advance team- together each achieve more ravi belkhindi clydeunion automation engineer quick |
所有的时间均为北京时间。 现在的时间是 04:23 PM. |