Difference between revisions of "KeychainItem.Label"
From Xojo Documentation
(SMBot: new page by automated transformation) |
(→Example) |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{PropertyBox | {{PropertyBox | ||
| name=Label | | name=Label | ||
− | | owner=[[ | + | | owner=[[KeychainItem]] |
| ownertype=class | | ownertype=class | ||
| scope=public | | scope=public | ||
| type=[[String]] | | type=[[String]] | ||
− | | platform= | + | | platform=mac |
}} | }} | ||
− | End-user editable string containing the label for this Keychain item. | + | {{Description |
+ | |text = End-user editable string containing the label for this Keychain item. }} | ||
+ | |||
+ | ==Example== | ||
+ | |||
+ | This example sets the text in a [[DesktopTextField|TextField]] to the value of the Label property. | ||
+ | |||
+ | <rbcode> | ||
+ | Dim kc As Keychain | ||
+ | Dim kci As KeychainItem | ||
+ | |||
+ | kc = New Keychain(Listbox1.SelectedIndex) | ||
+ | |||
+ | If kc <> Nil Then | ||
+ | kci = New KeychainItem | ||
+ | kci.ServiceName = SearchField.Text | ||
+ | |||
+ | PasswordField.Text = kc.FindPassword(kci) | ||
+ | |||
+ | ServiceNameField.Text = kci.ServiceName | ||
+ | AccountNameField.Text = kci.AccountName | ||
+ | CommentField.Text = kci.Comment | ||
+ | LabelField.Text = kci.Label | ||
+ | End If | ||
+ | </rbcode> |
Latest revision as of 21:20, 13 February 2022
Property (As String )
![]() |
This property is only available on the macOS platform. For cross-platform compatibility, use #If...#Endif with the Target... specifiers to make sure you will not attempt to use this property on an incompatible platform. |
aKeychainItem.Label = newStringValue
or
StringValue = aKeychainItem.Label
Supported for all project types and targets.
or
StringValue = aKeychainItem.Label
Supported for all project types and targets.
End-user editable string containing the label for this Keychain item.
Example
This example sets the text in a TextField to the value of the Label property.
Dim kc As Keychain
Dim kci As KeychainItem
kc = New Keychain(Listbox1.SelectedIndex)
If kc <> Nil Then
kci = New KeychainItem
kci.ServiceName = SearchField.Text
PasswordField.Text = kc.FindPassword(kci)
ServiceNameField.Text = kci.ServiceName
AccountNameField.Text = kci.AccountName
CommentField.Text = kci.Comment
LabelField.Text = kci.Label
End If
Dim kci As KeychainItem
kc = New Keychain(Listbox1.SelectedIndex)
If kc <> Nil Then
kci = New KeychainItem
kci.ServiceName = SearchField.Text
PasswordField.Text = kc.FindPassword(kci)
ServiceNameField.Text = kci.ServiceName
AccountNameField.Text = kci.AccountName
CommentField.Text = kci.Comment
LabelField.Text = kci.Label
End If