www.1862.net > vB运行基础代码

vB运行基础代码

'问题1:运行某个程序后自动退出当前程序的代码 '执行 Shell(F,1) Shell "NotePad.exe", 1 '启动记事本 Unload Me '或 End 退出 '问题2:运行.lnk格式文件 Dim ChengXu As String, F As String F = "C:\My.lnk" ChengXu = "rundll32.exe url.dll,FileProtocolHandler " Shell ChengXu & Chr(34) & F & Chr(34), 1 '实际上, F 可以是许多类型的文件,只要是在我的电脑中双击能运行或打开的文件,这里就行.

vb的石头剪刀布. rem 窗体创建三个单选框按钮,option1、option2、option3 private sub form_activate() option1.caption = "石头" option2.caption = "剪刀" option3.caption = "布" option1.value = false option2.value = false option3.value

Private Sub Text1_Change()If Not IsNumeric(Text1.Text) Then Text1.Text = ""End IfEnd SubTEXT只能输入数字,这个基础吧.

用vb编程工具,编写后生成可执行程序,即可运行

'加个按钮,两个文本框,文本框MultiLine属性改为true Private Sub Command1_Click() Dim Num(60) As Integer Dim TempNum As Integer Dim i As Integer, j As Integer Randomize For i = 1 To 60 Num(i) = 100 + 100 * Rnd Print Num(i); If i Mod 10

private sub command1_click() text1.text="欢迎使用VB“ command1.enabled=false command2.enabled=true end sub 这段的意思是 在点击command1时 会在text1里显示"欢迎使用VB" 然后command1不可用(就是此command不能被点击,

1.数值型函数:abs(num): 返回绝对值sgn(num): num>0 1; num=0 0; num<0 -1;判断数值正负hex(num): 返回十六进制值 直接表示:&Hxx 最大8位oct(num): 返回八进制值 直接表示:&Oxx 最大8位sqr(num): 返回平方根 num>0int(num): 取

首先,您的代码应该这样写才对:Dim strtemp As String * 60 Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDrectoryA" (ByVal lpBuffer As String, ByVal nsize As Long) As Long ' 创建引用 Private Sub

字符编码?GB2312 UTF-8 UNICON ASCII等等.

Private Sub Command1_Click() Text1.Font.Bold = Check1.Value Text1.Font.Italic = Check2.Value Text1.Font.Underline = Check3.Value Text1.Font.Strikethrough = Check4.Value Text1.RefreshEnd Sub Private Sub Form_Load() Text1.Text = "一去二三里," + vbCrLf + "烟村四五家"End Sub 没有全部写出,按这个写就行了,给的奖励太少,哈哈

网站地图

All rights reserved Powered by www.1862.net

copyright ©right 2010-2021。
www.1862.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com