明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 51158|回复: 128

[翔麟专集] [原创]翔麟专集——抽屉式菜单窗体和面板

  [复制链接]
发表于 2009-9-22 11:00 | 显示全部楼层 |阅读模式

在不利用第三方控件的环境下实现抽屉式菜单窗体和面板

以下是抽屉式菜单窗体的效果图:

具体实现的源码工程文件:


以下是抽屉式菜单面板的效果图:

具体实现的源码工程文件:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x

评分

参与人数 6威望 +1 明经币 +4 金钱 +65 贡献 +5 激情 +5 收起 理由
BaoWSE + 1 很给力!
3xxx + 1
soly2006 + 20 不错!赞一个!
mygisstudy + 5
sliangyu + 20
雪山飞狐_lzh + 1 + 2 + 20 + 5 + 5 【精华】好程序

查看全部评分

发表于 2018-10-14 23:26 | 显示全部楼层
晕就是不倒 发表于 2018-2-26 09:52
为什么我购买了附件但是无法下载呢?

下载正常啊。是你不会下吧?
发表于 2018-2-26 09:52 | 显示全部楼层
为什么我购买了附件但是无法下载呢?
发表于 2017-12-13 16:50 | 显示全部楼层
下载了,值得学习,正在做面板呢
发表于 2009-9-22 11:13 | 显示全部楼层

好资料 价格很便宜!

发表于 2009-9-22 12:40 | 显示全部楼层

好东西支持

发表于 2009-9-22 16:07 | 显示全部楼层
我没有钱  我不能下 但是我也想学习 。。。。
发表于 2009-9-22 20:50 | 显示全部楼层

怎么不能用呢?

是F5,netload,然后输入LoadPanel吧?没反应,根本不执行[CommandMethod("LoadPanel")]后的语句

点评

把acdbmgd.dll,acmgd.dll复制本地设置为false  发表于 2014-2-26 20:36
发表于 2009-9-23 08:00 | 显示全部楼层

现留着,有钱了再来

 楼主| 发表于 2009-9-23 08:52 | 显示全部楼层
以下是调用面板的代码:
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Autodesk.AutoCAD.Runtime;
  6. using Autodesk.AutoCAD.EditorInput;
  7. [assembly: CommandClass(typeof(ClassLibrary1.Class1))]
  8. namespace ClassLibrary1
  9. {
  10.     public class Class1
  11.     {
  12.         public static Autodesk.AutoCAD.Windows.PaletteSet ps;
  13.         [CommandMethod("LoadPanel")]
  14.         public void loadPanel()
  15.         {
  16.             Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
  17.             try
  18.             {
  19.                 string strTagText = "抽屉式的菜单";
  20.                 if (ps == null || ps.IsDisposed)
  21.                 {
  22.                     ps = new Autodesk.AutoCAD.Windows.PaletteSet(strTagText);
  23.                     System.Windows.Forms.UserControl myCtrl = new UcMain();
  24.                     ps.Add(strTagText, myCtrl);
  25.                 }
  26.                 ps.Visible = true;
  27.                 ps.Size = new System.Drawing.Size(150, 2000);
  28.                 ps.Dock = Autodesk.AutoCAD.Windows.DockSides.Left;
  29.                 ps.KeepFocus = true;
  30.                 ps.Opacity = 50;
  31.             }
  32.             catch
  33.             {
  34.                 ed.WriteMessage("Error Showing Palette");
  35.             }
  36.         }
  37.     }
  38. }
------------------------------------------------------------------------------------------------------
怎么不能用呢?
是F5,netload,然后输入LoadPanel吧?没反应,根本不执行[CommandMethod("LoadPanel")]后的语句

实在不行的话,你在命名空间上面加这句:
  1. [assembly: CommandClass(typeof(ClassLibrary1.Class1))]
复制代码
发表于 2009-9-23 10:47 | 显示全部楼层

学习一下

发表于 2009-9-23 21:33 | 显示全部楼层
谢谢翔麟.
发表于 2009-9-24 09:35 | 显示全部楼层
谢谢分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-26 11:12 , Processed in 2.399231 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表