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

C# NX二次开发:字符串控件StringBlock讲解

大家好,今天介绍ug二次开发过程中的一个叫字符串的控件,这个控件在块UI编辑器中可以使用。

下面是这个控件中的一些属性和方法:

1、 protected internal StringBlock();

        //
        // 摘要:
        //     Returns or sets the WideValue.返回或设置宽值。
        //
        // 备注:
        //     Specifies the International text. This property accepts international characters
        //     supported by NX.
        //     Created in NX8.5.0
        //     Deprecated in NX12.0.0. Use 'Value' instead which supports Internationalization.
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        [Obsolete("Deprecated in NX12.0.0.  Use 'Value' instead which supports Internationalization.")]
     2、  public string WideValue { get; set; }
        //
        // 摘要:
        //     Returns or sets the Value:返回或设置值
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
       
        //
        // 摘要:
        //     Returns or sets the Tooltip
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public string Tooltip { get; set; }
        //
        // 摘要:
        //     Returns or sets the RetainValue
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public bool RetainValue { get; set; }
        //
        // 摘要:
        //     Returns or sets the ReadOnlyString
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public bool ReadOnlyString { get; set; }
        //
        // 摘要:
        //     Returns or sets the PresentationStyle as string
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public string PresentationStyleAsString { get; set; }
        //
        // 摘要:
        //     Returns or sets the MaxTextLength
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public int MaxTextLength { get; set; }
        //
        // 摘要:
        //     Returns or sets the Localize
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public bool Localize { get; set; }
        //
        // 摘要:
        //     Returns or sets the IsPassword.
        //
        // 备注:
        //     If true, characters will not be readable. They will be displayed as *.
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public bool IsPassword { get; set; }
        //
        // 摘要:
        //     Returns or sets the Bitmap
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public string Bitmap { get; set; }
        //
        // 摘要:
        //     Returns or sets the Width as string
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public string WidthAsString { get; set; }
        //
        // 摘要:
        //     Returns or sets the BalloonTooltipLayout as string
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        public string BalloonTooltipLayoutAsString { get; set; }
        //
        // 摘要:
        //     Returns or sets the AllowInternationalTextInput
        //
        // 备注:
        //     Created in NX8.5.0
        //     Deprecated in NX12.0.0. Not required from NX10 onwards. Internationalization
        //     is available by default.
        //     License requirements to get this property: None.
        //     License requirements to set this property: None.
        [Obsolete("Deprecated in NX12.0.0.  Not required from NX10 onwards. Internationalization is available by default.")]
        public bool AllowInternationalTextInput { get; set; }

        //
        // 摘要:
        //     Gets the BalloonTooltipImages
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements: None.
        public string[] GetBalloonTooltipImages();
        //
        // 摘要:
        //     Gets the BalloonTooltipLayout members
        //
        // 返回结果:
        //     Values to get from the property
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements: None.
        public string[] GetBalloonTooltipLayoutMembers();
        //
        // 摘要:
        //     Gets the BalloonTooltipTexts
        //
        // 返回结果:
        //     Values to get from the property.
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements: None.
        public string[] GetBalloonTooltipTexts();
        //
        // 摘要:
        //     Gets the ListItems
        //
        // 返回结果:
        //     Values to get from the property
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements: None.
        public string[] GetListItems();
        //
        // 摘要:
        //     Gets the PresentationStyle members
        //
        // 返回结果:
        //     Values to get from the property.
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements: None.
        public string[] GetPresentationStyleMembers();
        //
        // 摘要:
        //     Gets the Width members
        //
        // 返回结果:
        //     Values to get from the property.
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements: None.
        public string[] GetWidthMembers();
        //
        // 摘要:
        //     Sets the BalloonTooltipImages
        //
        // 参数:
        //   imageStrings:
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements: None.
        public void SetBalloonTooltipImages(string[] imageStrings);
        //
        // 摘要:
        //     Sets the BalloonTooltipTexts
        //
        // 参数:
        //   tooltipTextArray:
        //     Value to set for the property.
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements: None.
        public void SetBalloonTooltipTexts(string[] tooltipTextArray);
        //
        // 摘要:
        //     Sets the keystroke callback for Block Styler String Block.
        //
        // 参数:
        //   cb:
        //     Callback function for keystroke event.
        //
        // 备注:
        //     Created in NX12.0.1
        //     License requirements: None.
        public void SetKeystrokeCallback(KeystrokeCallback cb);
        //
        // 摘要:
        //     Sets the ListItems
        //
        // 参数:
        //   itemStrings:
        //     Value to set to the property
        //
        // 备注:
        //     Created in NX8.5.0
        //     License requirements: None.
        public void SetListItems(string[] itemStrings);

        //
        // 摘要:
        //     The keystroke callback that is registered by calling NXOpen.BlockStyler.StringBlock.SetKeystrokeCallback(NXOpen.BlockStyler.StringBlock.KeystrokeCallback).
        //
        // 参数:
        //   stringBlock:
        //     String Block object for which keystroke event is invoked
        //
        //   uncommittedValue:
        //     The text being typed in the string block at runtime
        //
        // 备注:
        //     It will get called for each key stroke the user makes in the String Block input
        //     field.
        //     Created in NX12.0.1
        //     License requirements: None.
        public delegate int KeystrokeCallback(StringBlock stringBlock, string uncommittedValue);

上面这些中比较常用的有以下几个:

1、获取字符串控件中的值: public string Value { get; set; }

2、返回或设置控件只读:public bool ReadOnlyString { get; set; }

本篇文章要介绍的就是这么多,我们下篇文章再见。

http://www.dtcms.com/a/338288.html

相关文章:

  • 【MongoDB】常见八股合集,mongodb的特性,索引使用,优化,事务,ACID,聚合查询,数据复制机制,理解其基于raft的选举机制
  • 虚拟货币(BTC)走势分析指标体系
  • JMeter与大模型融合应用之构建AI智能体:评审性能测试脚本
  • 浅入浅出常见敏感数据处理的加密算法
  • 如何在 Ubuntu 24.04 或 22.04 LTS 上安装 PowerShell
  • SHA-256 详解
  • UE5 批量编译蓝图技巧
  • Linux Miniconda安装教程与conda常用指令介绍
  • 区块链数字存证应用
  • 健身房预约系统SSM+Mybatis实现(四、登录页面+JWT+注销)
  • 【前端智能化】AG-UI实践及原理浅析
  • 决策树的笔记
  • steal tsoding‘s pastebeam code as go server
  • 芋道审批流配置流程表单超详细介绍
  • 15.web api 6
  • Unity 中控开发 多路串口服务器(一)
  • 【Goland】:数组与切片
  • 【25-cv-09352】Maradona 品牌维权,从球衣到周边全品类侵权高危
  • Jupyter 中实现交互式图表:ipywidgets 从入门到部署
  • 【数据集】全球大气监测计划(GAW)简介
  • 用户认证技术与HTTP协议
  • 基于pychrm工具的python读取 USB 摄像头(实时+保存录像+摄像头信息打印+镜像)—— OpenCV库
  • 【React Hooks】封装的艺术:如何编写高质量的 React 自-定义 Hooks
  • 【高等数学】第九章 多元函数微分法及其应用——第七节 方向导数与梯度
  • Localhost和127.0.0.1
  • 数据库原理及应用_数据库基础_第2章关系数据库标准语言SQL_数据类型表操作(定义、操作和修改)
  • 终极方案!lightRag/graphRag离线使用tiktoken持续报错SSLError,不改源码,彻底解决!
  • MySQL和HiveSQL在查询上的区别
  • 上网行为管理
  • 用户认证与应用控制技术