vb做的大小写字母转换器
'大小写字母转换器vb
'界面包括 command、command1、command2、command3 和一个 text 文本框
'command 为“互转”按钮,command1 为“转大”按钮,command2 为“转小”按钮,command3 为“清除”按钮
Private Sub Command_Click()
Dim i As Integer, n As Integer
Dim x As String, y As Integer, z
i = Len(Text.Text)
x = Text.Text
Text.Text = ""
For n = 1 To i
z = Mid(x, n, 1)
y = Asc(z)
If y > 96 And y < 123 Then
z = UCase(z)
ElseIf y > 64 And y < 91 Then
z = LCase(z)
End If
Text.Text = Text.Text & z
Next
End Sub
Private Sub Command1_Click()
Dim i As Integer, n As Integer
Dim x As String, y As Integer, z
i = Len(Text.Text)
x = Text.Text
Text.Text = ""
For n = 1 To i
z = Mid(x, n, 1)
y = Asc(z)
If y > 96 And y < 123 Then
z = UCase(z)
ElseIf y > 64 And y < 91 Then
z = z
End If
Text.Text = Text.Text & z
Next
End Sub
Private Sub Command2_Click()
Dim i As Integer, n As Integer
Dim x As String, y As Integer, z
i = Len(Text.Text)
x = Text.Text
Text.Text = ""
For n = 1 To i
z = Mid(x, n, 1)
y = Asc(z)
If y > 96 And y < 123 Then
z = z
ElseIf y > 64 And y < 91 Then
z = LCase(z)
End If
Text.Text = Text.Text & z
Next
End Sub
Private Sub Command3_Click()
Text.Text = ""
End Sub
相关文档:
VBA
命名规则及代码规范
马维峰
(maweifeng@263.net
)
1.
VBA
命名规则
一个好的命名规则可以提高程序的可读性,减少错误发生的概率,命名规则不是一定的,不同的人有不同的规则和习惯,但在编程过程中,对于个人或工作组,一定要遵守相同的命名规则。
1.1. ......
调用方法很简单,在Form中如下书写代码:
Private Sub Form_Load()
SetHotkey 1, "Ctrl,112", "Add" '按 Ctrl+F1 激活指定程序,F1的Ascii码为112
SetHotkey 2, 113, "Add" '按 F2 激活指定程序,F2的Ascii码为113
SetHotkey 3, "Ctrl+Alt,113", "Add" '按 Ctrl+Alt+F2 激活指定程序,F2的Ascii码为113
End Sub
Priva ......
'*************************************************************************
''----------------------------------------------------------------------
'**系统名称:子类化重绘仿QQ2009渐变按钮
'**模块描述:
'**模 块 名:Form1
'**创 建 人:gvu
'**作者网站:http://hi.baidu.com/googlevipuser
'**E-Mai ......
摘自VB吧高手鲸无敌兄的一段管首示例代码:
'******* 读取DOS程序ipconfig.exe的返回结果: ********
'作者: 鲸无敌 2006-10-19 21:57
'**************************************************
'窗体代码:Form1
'**************************************************
Option Explicit
Private Const NOR ......