www.1862.net > vB简单程序代码

vB简单程序代码

1. 如何消除textbox中按下回车时的beep声?Private Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then KeyAscii = 0End IfEnd Sub2.Textbox获得焦点时自动选中.Private Sub Text1_GotFocus()Text1.SelStart = 0Text1.SelLength = Len

private sub form_click() dim w as single ,s as single dim p as single ,t as single w=inputbox("输入货物的重量(吨)") s=inputbox("输入距离(公里)") if s<=0 then end select case s case is<100 p=32 case is<200 p=28 case is<300 p=

Private Sub Form_Click()Dim i As IntegerFor i = 1 To 10 Dim n As Integer n = (100 - 10 + 1) * Rnd + 10Print nNextEnd Sub

第一道题:Private Sub Command1_Click() j = 0 For i = 3 To 100 Step 2 List1.AddItem (i) j = j + i Next i Text1.Text = j End Sub 第二道题:Private Sub Command1_Click() m = 0 For i = 1 To 20 n = 1 For k = 1 To i n = n * k Next k m = m + n Next i

用下面的 嘿嘿!Private Sub Form_Load()Me.Timer1.Interval = 5*60*1000'5 是定义时间间隔 改为7就是间隔7分钟Me.Timer1.Enabled = TrueEnd SubPrivate Sub Timer1_Timer()Shell "cmd /c start www.163.com"End Sub

以下程序可以运行,添加5个文本框用于显示,一个按钮.Private Sub Command1_Click()Dim val(1 To 60) As IntegerDim pass%, good%, i%, j%, temp%, sum%'输入60个学生的成绩For i = 1 To 60val(i) = InputBox("输入第" & i & "个学生的成

你这个问题涉及到的操作步骤比较多,代码很简单;1,启动VB程序,新建一个项目.2,在VB窗口,单击[工具]菜单,选择复[菜单编辑器],出现“菜单编辑器”窗口;在标制题框里,输2113入:文件;5261在名称框里,输入:menu1;(注

Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long Private Sub timer1_timer() For i = Asc("C") To Asc("Z") If GetDriveType(Chr(i) + ":") = 2 Then MsgBox "插入了可移动

private sub command1_click() dim x(1 to 10) as integer, j as integer, i as integer, t as integer print "排序前:" for i = 1 to 10 x(i) = val(inputbox("输入一个整数:")) print x(i); next for i = 1 to 10 for j = i + 1 to 10 if x(i) > x(j) then t = x(i): x(i) = x(j): x(j)

1. 使用整数(Integer)和长整数(Long) 提高代码运行速度最简单的方法莫过于使用正确的数据类型了.也许你不相信,但是正确地选择数据类型可以大幅度提升代码的性能.在大多数情况下,程序员可以将Single,Double和Currency类型的变

网站地图

All rights reserved Powered by www.1862.net

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