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
英文地址,請注明出處:http://en.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…