本文整理汇总了VB.NET中System.Windows.Forms.DomainUpDown.DomainUpDownItemCollection类的典型用法代码示例。如果您正苦于以下问题:VB.NET DomainUpDown.DomainUpDownItemCollection类的具体用法?VB.NET DomainUpDown.DomainUpDownItemCollection怎么用?VB.NET DomainUpDown.DomainUpDownItemCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DomainUpDown.DomainUpDownItemCollection类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: InitializeMyDomainUpDown
Protected domainUpDown1 As DomainUpDown
Private Sub InitializeMyDomainUpDown()
' Create and initialize the DomainUpDown control.
domainUpDown1 = New DomainUpDown()
' Add the DomainUpDown control to the form.
Controls.Add(domainUpDown1)
End Sub
Private Sub button1_Click(sender As Object, e As EventArgs)
' Add the text box contents and initial location in the collection
' to the DomainUpDown control.
domainUpDown1.Items.Add((textBox1.Text.Trim() & " - " & myCounter))
' Increment the counter variable.
myCounter = myCounter + 1
' Clear the TextBox.
textBox1.Text = ""
End Sub
Private Sub checkBox1_Click(sender As Object, e As EventArgs)
' If Sorted is set to true, set it to false;
' otherwise set it to true.
If domainUpDown1.Sorted Then
domainUpDown1.Sorted = False
Else
domainUpDown1.Sorted = True
End If
End Sub
Private Sub domainUpDown1_SelectedItemChanged _
(sender As Object, e As EventArgs)
' Display the SelectedIndex and
' SelectedItem property values in a MessageBox.
MessageBox.Show(("SelectedIndex: " & domainUpDown1.SelectedIndex.ToString() & _
ControlChars.Cr & "SelectedItem: " & domainUpDown1.SelectedItem.ToString()))
End Sub