📄 defaultvb.aspx.vb
字号:
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports Telerik.QuickStart
Imports Telerik.WebControls
Imports Telerik.WebControls.CallbackControls
Namespace Telerik.CallbackExamplesVB.Controls.TextBox
'/ <summary>
'/ Summary description for _Default.
'/ </summary>
Public Class DefaultVB
Inherits XhtmlPage
Protected Label1 As System.Web.UI.WebControls.Label
Protected Label2 As System.Web.UI.WebControls.Label
Protected Label3 As System.Web.UI.WebControls.Label
Protected Label4 As System.Web.UI.WebControls.Label
Protected Label5 As System.Web.UI.WebControls.Label
Protected Label9 As System.Web.UI.WebControls.Label
Protected Label11 As System.Web.UI.WebControls.Label
Protected lblLetters As System.Web.UI.WebControls.Label
Protected lblConsonants As System.Web.UI.WebControls.Label
Protected lblVowels As System.Web.UI.WebControls.Label
Protected lblCapitals As System.Web.UI.WebControls.Label
Protected Label6 As System.Web.UI.WebControls.Label
Protected lblWhiteSpace As System.Web.UI.WebControls.Label
Protected Label7 As System.Web.UI.WebControls.Label
Protected lblPunctuators As System.Web.UI.WebControls.Label
Protected WithEvents Label8 As System.Web.UI.WebControls.Label
Protected WithEvents statusLabel As System.Web.UI.WebControls.Label
Protected WithEvents LoadingPanel1 As Telerik.WebControls.LoadingPanel
Protected WithEvents Img1 As System.Web.UI.HtmlControls.HtmlImage
Protected WithEvents CallbackTextBox1 As Telerik.WebControls.CallbackTextBox
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub 'Page_Load
' Put user code to initialize the page here
#Region "Web Form Designer generated code"
Protected Overrides Sub OnInit(ByVal e As EventArgs)
'
' CODEGEN: This call is required by the ASP.NET Web Form Designer.
'
InitializeComponent()
MyBase.OnInit(e)
End Sub 'OnInit
'/ <summary>
'/ Required method for Designer support - do not modify
'/ the contents of this method with the code editor.
'/ </summary>
Private Sub InitializeComponent()
End Sub 'InitializeComponent
#End Region
Private Function GetConsonants(ByVal s As String) As Integer
Dim count As Integer = 0
Dim ch As Char
For Each ch In s
If Char.IsLetter(ch) Then
Select Case ch
Case "a"c, "e"c, "i"c, "o"c, "u"c, "y"c
Exit Select
Case Else
count += 1
Exit Select
End Select
End If
Next ch
Return count
End Function 'GetConsonants
Private Function GetVowels(ByVal s As String) As Integer
Dim count As Integer = 0
Dim ch As Char
For Each ch In s
Select Case ch
Case "a"c, "e"c, "i"c, "o"c, "u"c, "y"c
count += 1
Exit Select
End Select
Next ch
Return count
End Function 'GetVowels
Private Function GetWhiteSpaces(ByVal s As String) As Integer
Dim count As Integer = 0
Dim ch As Char
For Each ch In s
If Char.IsWhiteSpace(ch) Then
count += 1
End If
Next ch
Return count
End Function 'GetWhiteSpaces
Private Function GetCapitals(ByVal s As String) As Integer
Dim count As Integer = 0
Dim ch As Char
For Each ch In s
If Char.IsUpper(ch) Then
count += 1
End If
Next ch
Return count
End Function 'GetCapitals
Private Function GetPunctuators(ByVal s As String) As Integer
Dim count As Integer = 0
Dim ch As Char
For Each ch In s
If Char.IsPunctuation(ch) Then
count += 1
End If
Next ch
Return count
End Function 'GetPunctuators
Private Sub CallbackTextBox1_KeyUp(ByVal sender As Object, ByVal args As KeyEventArgs) Handles CallbackTextBox1.KeyUp
Label1.Text = CallbackTextBox1.Text
lblLetters.Text = Label1.Text.Length.ToString()
lblConsonants.Text = GetConsonants(Label1.Text).ToString()
lblVowels.Text = GetVowels(Label1.Text).ToString()
lblCapitals.Text = GetCapitals(Label1.Text).ToString()
lblWhiteSpace.Text = GetWhiteSpaces(Label1.Text).ToString()
lblPunctuators.Text = GetPunctuators(Label1.Text).ToString()
End Sub 'CallbackTextBox1_KeyUp
End Class 'DefaultVB
End Namespace 'Telerik.CallbackExamplesVB.Controls.TextBox
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -