当前位置: 首页 > news >正文

公司网站如何做维护百度自动优化

公司网站如何做维护,百度自动优化,企业网站建设收费标准,太原网站建设利用参考文献2,添加面板 执行treeControl New UCTreeView()时报一个错误: 用户代码未处理 System.ArgumentException HResult-2147024809 Message控件不支持透明的背景色。 SourceSystem.Windows.Forms StackTrace: 在 System.Windows…

利用参考文献2,添加面板

执行treeControl = New UCTreeView()时报一个错误:

用户代码未处理 System.ArgumentException
  HResult=-2147024809
  Message=控件不支持透明的背景色。
  Source=System.Windows.Forms
  StackTrace:
       在 System.Windows.Forms.Control.set_BackColor(Color value)
       在 System.Windows.Forms.Form.set_BackColor(Color value)
       在 Autodesk.AutoCAD.Windows.AcMgWinformPalette.ResyncToTheme(AcMgWinformPalette* )
       在 Autodesk.AutoCAD.Windows.AcMgWinformPalette.Create(AcMgWinformPalette* , CAdUiPaletteSet* pParentWnd)
       在 Autodesk.AutoCAD.Windows.PaletteSet.AddCore(String name, AcMgPalette* pPal)
       在 Autodesk.AutoCAD.Windows.PaletteSet.Add(String name, Control control)
       在 odpmMagProcess.Palettes.Palettes.ShowPalette() 位置 D:\testVBNet\ODPM\odpmMagProcess\Class3.vb:行号 28
       在 Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
       在 Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
       在 Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)
       在 Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()
  InnerException: 

搜索了1天关于这个问题的解决方案,并且尝试了这些方案,都没有很好地解决这个问题。

半拉子的解决办法是,给UCDockDrag和UCTteeView添加了构造函数

UCDockDrag.vb

Public Sub New()

        ' 此调用是设计器所必需的。
        InitializeComponent()

        ' 在 InitializeComponent() 调用之后添加任何初始化。
        SetStyle(ControlStyles.SupportsTransparentBackColor, True)
        comboBoxDock.BackColor = Color.Red
        textBoxDrag.BackColor = Color.Red
        Me.BackColor = Color.Red
        Me.TransparencyKey = Me.BackColor

    End Sub

UCTteeView.vb

Public Class UCTreeView
    Public Sub New()

        ' 此调用是设计器所必需的。
        InitializeComponent()

        ' 在 InitializeComponent() 调用之后添加任何初始化。
        SetStyle(ControlStyles.SupportsTransparentBackColor, True)
        treeViewEnts.BackColor = Color.Red
        dataGridViewEnts.BackgroundColor = Color.Red
        'TransparencyKey = Color.FromArgb(1, 0, 0, 0)

        Me.BackColor = Color.Red
        Me.TransparencyKey = Me.BackColor

    End Sub

调试的结果如下:

使用用户控件以后,就没有问题了

面板内的控件都不显示。

换一种思路,搜索其他添加面板的方法。

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Windows
Imports System.Windows.Forms

Namespace Palettes
    Public Class Class4
        <CommandMethod("CreatePalette")>
        Public Sub CreatePalette()
            '初始化面板集对象
            Dim ps As PaletteSet = New PaletteSet("我的窗体")
            ps.MinimumSize = New System.Drawing.Size(300, 300)

            ' 创建用户自定义的窗体或控件
            Dim ctrl As UserControl = New UserControl()

            '添加控件到面板集中
            ps.Add("My Tab01", ctrl)
            ps.Add("My Tab02", ctrl)

            '显示面板
            ps.Visible = True

            '设置面板样式和透明度
            ps.Style = PaletteSetStyles.ShowTabForSingle
            ps.Opacity = 90

        End Sub

    End Class
End Namespace

图层选择

 <CommandMethod("SelectLayer")>
        Public Sub SelectLayer()
            Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
            If Not doc Is Nothing Then
                Dim ps As PaletteSet = New PaletteSet("Select Layer")
                ps.Style = PaletteSetStyles.ShowAutoHideButton Or PaletteSetStyles.ShowCloseButton
                ps.Size = New System.Drawing.Size(200, 100)
                Dim comboBox As System.Windows.Forms.ComboBox = New System.Windows.Forms.ComboBox()

                For Each layer As LayerTableRecord In GetLayerList()
                    comboBox.Items.Add(layer.Name)
                Next
                Dim okButton As System.Windows.Forms.Button = New System.Windows.Forms.Button()
                okButton.Text = "OK"
                AddHandler okButton.Click,
                    Sub(sender, e)
                        Dim selectedLayer As String = comboBox.SelectedItem.ToString()
                        Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog("Selected Layer: " + selectedLayer)
                    End Sub
                
                Dim panel As System.Windows.Forms.Panel = New System.Windows.Forms.Panel()

                panel.Controls.Add(comboBox)
                panel.Controls.Add(okButton)
                ps.Add("Select Layer", panel)
                ps.Visible = True

            End If

        End Sub

VS2013 的MSDN文档的ISO下载和安装见参考文献6

参考文献

AutoCAD C# 自动加载自定义RibbonUI界面_怎么给autocad换ui-CSDN博客

VB.net 关于给autoCAD添加 面板_application.getsystemvariable("menuname")-CSDN博客

https://bbs.csdn.net/topics/80039904

C# CAD交互界面-自定义面板集-comboBox选择图层_cad c#-CSDN博客

C# CAD交互界面-自定义面板集(四) - 技术栈

https://www.cnblogs.com/strangekitty/p/4707400.html

C#中=>使用_c# =>-CSDN博客

AddHandler 语句 - Visual Basic | Microsoft Learn

VB.NET 中动态添加按钮并添加点击事件-CSDN博客

Lambda 表达式 - Visual Basic | Microsoft Learn

http://www.tj-hxxt.cn/news/2999.html

相关文章:

  • 免费网址导航网站建设石家庄网络seo推广
  • 郑州有做网站的公司没深圳优化公司统高粱seo
  • 网站 购买小吃培训2000元学6项
  • 如何用域名访问网站成都网络推广外包公司哪家好
  • wordpress head文件夹关键词排名优化品牌
  • 建设网站虚拟主机店铺如何运营和推广
  • 寮步网站建设价钱免费培训课程
  • 有网站怎么做app谷歌搜索引擎首页
  • 网站建设全国排名关键词自动生成器
  • dw设计一个简单网站网络营销好不好
  • 有几个网站如何做外贸网站推广找客户
  • 可以自己做网站做宣传吗营销技巧有哪些
  • 免费做销售网站有哪些公司官网制作多少钱
  • 深圳网站设计九曲seo推广优化多少钱
  • 做外贸是哪里网站小说推广接单平台
  • 交流平台网站怎么做广告推广怎么找客户
  • 长沙网站建设价百度企业号
  • 德阳百度网站建设网建
  • 利用网站宣传 两学一做宁波网络推广产品服务
  • 兴仁市建设局网站seo服务外包
  • 企业网站重要吗百度服务中心投诉
  • 哈尔滨网站建设一薇ls15227天津做优化好的公司
  • 昆明搭建微信网站哪家最优惠360站长
  • 网站建设人员需求分析杭州seo首页优化软件
  • 网站建设包含美工网络营销推广策划
  • 长安网站建设软件线上销售平台如何推广
  • 义乌做网站的网站seo排名培训
  • 单位网站及政务新媒体建设管理设计网络推广方案
  • 网站复制后台怎么办万网官网首页
  • 晋江seo青岛seo网站排名优化