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.pswp.cn/pingmian/93524.shtml
繁体地址,请注明出处:http://hk.pswp.cn/pingmian/93524.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【datawhale组队学习】n8n TASK01

教程地址:https://github.com/datawhalechina/handy-n8n/ 文章目录n8n节点的类别local-pc-deployn8n n8n 意思是 nodemation,是 node 与 automation 的组合词,读作 n-eight-n。 n8n 是一个开源的、基于节点的自动化工具,官方站点…

海洋牧场项目融资新曙光:绿色金融赋能蓝色经济发展

在海洋经济蓬勃发展的时代浪潮中,海洋牧场作为新兴的海洋产业模式,承载着保障国家粮食安全、促进海洋生态保护与可持续利用的重要使命。然而,海洋牧场项目的建设是一项庞大而复杂的系统工程,从前期的基础设施搭建、种苗培育&#…

51c大模型~合集170

自己的原文哦~ https://blog.51cto.com/whaosoft/14132244 #4DNeX 一张图,开启四维时空:4DNeX让动态世界 「活」起来 仅凭一张照片,能否让行人继续行走、汽车继续飞驰、云朵继续流动,并让你从任意视角自由观赏&#…

深入剖析以太坊虚拟机(EVM):区块链世界的计算引擎

引言:EVM——区块链世界的"计算引擎" 以太坊虚拟机(Ethereum Virtual Machine,EVM)是以太坊网络的核心创新,它不仅仅是一个执行环境,更是整个区块链生态系统的"计算引擎"。作为智能合…

深入分析 Linux PCI Express 子系统

深入分析 Linux PCI Express 子系统 一、PCI Express 工作原理 PCIe 是一种高速串行点对点互连协议,采用分层架构: #mermaid-svg-rsh0SW87JPR0aUxA {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid…

MySQL 运算符详解:逻辑、位运算与正则表达式应用

MySQL 运算符详解:逻辑、位运算与正则表达式应用 在 MySQL 中,运算符是构建复杂查询条件的基础。除了基础的算术和比较运算符,逻辑运算符、位运算符以及正则表达式的灵活运用,能让数据筛选更加精准高效。本文将系统讲解这些运算符…

<数据集>遥感飞机识别数据集<目标检测>

数据集下载链接https://download.csdn.net/download/qq_53332949/91702190数据集格式:VOCYOLO格式 图片数量:3842张 标注数量(xml文件个数):3842 标注数量(txt文件个数):3842 标注类别数:20 标注类别名称&#xf…

Windows从零到一安装KingbaseES数据库及使用ksql工具连接全指南

目录Windows从零到一安装KingbaseES数据库及使用ksql工具连接全指南前言第一部分:安装前准备1.1 系统要求检查1.2 下载安装包1.3 验证安装包完整性第二部分:安装KingbaseES2.1 启动安装程序2.2 接受许可协议2.3 选择授权文件2.4 设置安装目录2.5 选择安装…

Git+Jenkins 基本使用

一、什么是 JenkinsJenkins 是一个功能强大的应用程序,允许持续集成和持续交付项目(持续部署),无论用的是什么平台。这是一个免费的源代码,可以处理任何类型的构建或持续集成。集成 Jenkins 可以用于一些测试和部署技术…

Linux第十三讲:线程同步和互斥

Linux第十三讲:线程同步和互斥1.线程互斥1.1进程线程间的互斥背景概念1.2什么是锁1.2.1认识锁,理解锁2.线程同步2.1条件变量2.2生产和消费模型2.3基于阻塞队列(blockqueue)的生产消费模型2.3.1单生产,单消费的阻塞队列模拟实现2.3.2多生产&am…

SAP 简单的AMDP demo 练习使用

SAP AMDP(ABAP Managed Database Procedure)是SAP的一项先进技术,用于在SAP HANA数据库上执行高性能的数据库操作。它允许ABAP开发人员编写数据库过程,这些过程可以在数据库级别上执行,从而实现更快的数据处理和更高的…

Maven JAR Plugin 插件使用说明

Maven JAR Plugin 插件使用说明1 Maven JAR Plugin 插件地址2 Maven JAR Plugin 特点3 maven-assembly-plugin 的用法3.1 无依赖项 maven-jar-plugin 配置3.2 有依赖项 maven-jar-plugin 配置3.3 配合maven-dependency-plugin 将依赖复制到指定位置1 Maven JAR Plugin 插件地址…

QT+Yolov8 推理部署,ONNX模型 ,实例分割+目标检测

QTYolov8 实例分割、目标检测推理。QT源码。 程序准备/版本:QT creator QT6.8 编译器:MSVC2022 opencv:4.7 onnxruntime:1.16.0 cpu版本 QTyolo推理部署程序部分源码: #include "aitoolinterface.h" #include "ui_aitoolinterface.h" #include <QDebu…

【java实现一个接口多个实现类通用策略模式】

java实现同个接口多个实现类通用策略模式 项目业务中&#xff0c;有多个平台&#xff0c;多个平台直接有相同的业务&#xff0c;只有一个接口入口&#xff0c;但是 不同的平台入口&#xff0c;虽然接口相同&#xff0c;参数相同&#xff0c;但是各自的具体实现不同&#xff0c;…

leetcode-139. 单词拆分-C

暴力回溯回溯过程就是一个决策树模型&#xff0c;从所有选择中找到合适的继续&#xff0c;否则回到上一级继续。该方法思路简单&#xff0c;时间复杂度过高&#xff0c;大概1/4的用例超时。 bool backtrack(char *s, int cur, char** wordDict, int wordDictSize) {// 基线条件…

《彩色终端》诗解——ANSI 艺术解码(DeepSeek)

AIi诗解通吾灵&#xff0c;直抄原文享分玲。 笔记模板由python脚本于2025-08-18 23:35:59创建&#xff0c;本篇笔记适合喜欢诗&代码的coder翻阅。 学习的细节是欢悦的历程 博客的核心价值&#xff1a;在于输出思考与经验&#xff0c;而不仅仅是知识的简单复述。 Python官网…

抓包工具tcpdump详细指南

目录 1. 核心功能与特性 2. 关键参数速查表 3. 基础命令 3.1 协议/端口过滤 3.2 IP 地址过滤 3.3 高级逻辑组合 3.4 控制输出详细度 3.5 解析包内容 3.6 特殊包过滤 3.7 限制抓包数量 3.8 过滤特定大小包 3.9 过滤提升性能 ​​​​​​3.10 多网卡绑定 3.11 高级…

三高架构杂谈

我们的秒杀请求到了tomcat之后&#xff0c;我整个请求到了后端&#xff0c;我们怎么抗住高并发 也就是让他1s抗住10w的订单量&#xff0c;该怎么做 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>…

后端通用基础代码

后端通用基础代码 通用基础代码是指&#xff1a;“无论在任何后端项目中&#xff0c;都可以复用的代码。这种代码一般 “一辈子只用写一次” &#xff0c;了解作用之后复制粘贴即可&#xff0c;无需记忆。 目录结构如下&#xff1a;1、自定义异常 自定义错误码&#xff0c;对错…

基于51单片机WIFI心率计脉搏体温测量仪APP设计

1 系统功能介绍 本设计基于 STC89C52 单片机&#xff0c;结合 脉搏传感器、温度传感器 DS18B20、LCD1602 液晶显示器、WiFi 模块 等外设&#xff0c;构建了一个 WiFi 心率计脉搏体温测量仪 APP 系统。系统能够实现对人体心率与体温的实时采集、处理、显示和远程上传&#xff0c…