当前位置: 首页 > 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.lryc.cn/news/624929.html

相关文章:

  • Pandas 中常用的统计计算、排序、分组聚合
  • plantsimulation知识点25.8.18-从一个RGV到另一台RGV,工件长度和宽度方向互换
  • 【牛客刷题】计算1到n最低位1代表的数字之和
  • Layui COP证书管理系统
  • 《Image Classification with Classic and Deep Learning Techniques》复现
  • 吴恩达 Machine Learning(Class 1)
  • cross-env 与 @nestjs/config 的对比分析
  • 小杰机械视觉(one day)——基础阶段结束,进入机械学习阶段。
  • leetcode43. 字符串相乘
  • TEST_
  • 10CL016YF484C8G Altera FPGA Cyclone
  • 视觉语言导航(8)——任务驱动的架构增强 3.3
  • 矿物分类案例(二)数据填充后使用6种模型训练
  • Android中flavor的使用
  • PostgreSQL中的json_agg()
  • 初始向量数据库之Milvus
  • milvus如何存储特殊类型的数据
  • Milvus向量数据库安装步骤
  • 大厂 | 华为半导体业务部2026届秋招启动
  • 【大模型】RAG
  • 基于nvm安装管理多个node.js版本切换使用(附上详细安装使用图文教程+nvm命令大全)
  • ANSI终端色彩控制知识散播(I):语法封装(Python)——《彩色终端》诗评
  • 楼宇自控系统深化设计需关注哪些核心要点?技术与应用解析
  • 第一阶段C#-14:委托,事件
  • ReactNative开发实战——React Native开发环境配置指南
  • 机器翻译论文阅读方法:顶会(ACL、EMNLP)论文解析技巧
  • ADC的实现(单通道,多通道,DMA)
  • 如何编写自己的Spring容器
  • 【EI会议征稿】2025第四届健康大数据与智能医疗国际会议(ICHIH 2025)
  • VS Code Copilot 完整使用教程(含图解)