大家好,今天介紹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; }
本篇文章要介紹的就是這么多,我們下篇文章再見。